1.5 beta int/long performance issue

It would appear that 1.5 is noticeably slower when doing simple addition onint andlong values. 1.3 and 1.4 have similar performance charateristics. I have not tested other primitive types or other mathematical operations. All tests were performed on an AMD Athlon XP 1700+ using Windows 2000 SP3 and the latest releases of the respective SDKs. Because this testing is imprecise, some minor variation in run times is normal. The 1.0 run times are included just for fun :)

long a = System.currentTimeMillis(), b = 0L;

for (long x=-1; x++<1000000000;)continue;

b = System.currentTimeMillis();

System.out.println("time: " + (b-a) +"ms");

JDK

1.0.2 - time: 254938ms

1.5b1 - time:6125ms

1.4.2 - time: 5406ms

1.3.1 - time: 5156ms

long a = System.currentTimeMillis(), b = 0L;

for (int x=-1; x++<1000000000;)continue;

b = System.currentTimeMillis();

System.out.println("time: " + (b-a) +"ms");

JDK

1.0.2 - time: 129531ms

1.5b1 - time:4219ms

1.4.2 - time: 2453ms

1.3.1 - time: 2516ms

[1530 byte] By [inco5] at [2007-9-30 2:40:34]
# 1
Are not the beta builds is a 'debug' format where the release builds are not?
jschell at 2007-6-29 8:24:51 > top of Java-index,Administration Tools,Sun Connection...
# 2

I'm not re-compiling for each runtime. All runs use the exact same bytecodes (.class file) so I don't see how it makes a difference. I also had separate runs compiled with '-target 1.2' instead of '-target 1.1' but the differences were irrelevant, so I didn't post them. Integer incrementing should be a native function, and the presence or absence of debug symbols shouldn't make any difference with code like this.

inco5 at 2007-6-29 8:24:51 > top of Java-index,Administration Tools,Sun Connection...
# 3
I think he rather means the JVM. The beta JVM could be a debug and not optimised executable.
BIJ001 at 2007-6-29 8:24:51 > top of Java-index,Administration Tools,Sun Connection...
# 4
> I think he rather means the JVM. The beta JVM could be> a debug and not optimised executable. Yes.
jschell at 2007-6-29 8:24:51 > top of Java-index,Administration Tools,Sun Connection...