>From Raffaello
are java.lang classes better served by the JVM than other classes?
Here's a small experiment.
I created a MyInteger class that exposes the very same
implementation
of Integer.numberOfTrailingZeros(int), copied verbatim.
We did similar micro benchmarks, using Hanoi as a test case, to see the
speed variations
the various types of integers would have. We tried int, long, Long and
our version of
a boxed long. One case where we saw a 3-5x difference was between boxed
and
primitive versions. This was expected.
The other case was when we compared our custom boxed long with the Java
Long.
We found the issue here was with the creation and collection of instances.
The use of
the integer cache made a huge difference. Once we did that out times
became very close.
So while there may be internal optimization by the JVM in the Hanoi case
it had a minor
effect.
regards
mark
_______________________________________________
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev