Last night while working on something else I noticed a huge slowdown in the
cost of the String constructors that take byte arrays and the String.getBytes
methods, which convert characters back into bytes. This affects Win32 only,
and is quite serious. The following program:
import java.util.Random;
public class E2 {
public static void main(String[] args) throws Exception {
int n = 100000;
Random r = new Random(0);
int s = 0;
for (int i = 0; i < n; i++) {
byte[] b = Integer.toString(r.nextInt()).getBytes();
s += b[0];
}
System.out.println(s);
}
}
runs on my 266MHz P2 machine in 2.19s using 1.2beta4 and in 45.47s using
1.2fcs-D. This problem may also explain the recent ~10% slowdowns in two
string-intensive SPEC benchmarks, db and javac.
This problem only arises if you don't have i18n.jar installed. Since we expect
many Win32 users not to have this jar file, this problem must be fixed for FCS.
-- mr@eng 8/7/1998
cost of the String constructors that take byte arrays and the String.getBytes
methods, which convert characters back into bytes. This affects Win32 only,
and is quite serious. The following program:
import java.util.Random;
public class E2 {
public static void main(String[] args) throws Exception {
int n = 100000;
Random r = new Random(0);
int s = 0;
for (int i = 0; i < n; i++) {
byte[] b = Integer.toString(r.nextInt()).getBytes();
s += b[0];
}
System.out.println(s);
}
}
runs on my 266MHz P2 machine in 2.19s using 1.2beta4 and in 45.47s using
1.2fcs-D. This problem may also explain the recent ~10% slowdowns in two
string-intensive SPEC benchmarks, db and javac.
This problem only arises if you don't have i18n.jar installed. Since we expect
many Win32 users not to have this jar file, this problem must be fixed for FCS.
-- mr@eng 8/7/1998
- relates to
-
JDK-4163171 117regress: WIN32 only data corruption on IMAGE files using HTTP URL's.
-
- Closed
-