Need reviewer for forward port of 6815768 (File.getXXXSpace) and 6815768 (String.hashCode)
Ulf Zibis
Ulf.Zibis at gmx.de
Fri Feb 26 22:51:02 UTC 2010
Am 26.02.2010 20:32, schrieb Alan Bateman:
> Ulf Zibis wrote:
> For these other suggestions it would be great to create
> micro-benchmarks and try our your changes.
>
> For now though, as I said, I'm just fixing the method to avoid the
> store for the empty string case.
I've run a benchmark for your "avoid the store for the empty string case":
a1.equals(a2)
a1.equals(a2)
hashCode() warmup = 25,469 ms
hashCode1() warmup = 116,709 ms
hashCode() time = 11,789 ms
hashCode1() time = 17,744 ms
hashCodes sum = 0
My machine (notebook): 2Ghz Intel Centrino, single core, I32 architecture.
I can't see any advantage of this code. As I guessed before, HotSpot
server compiler seems to first examine the count value before doing
anything.
Run main() of:
https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio-charset-enhanced/branches/j7_EUC_TW/src/java/lang/String.java?rev=954&view=markup
-Ulf
More information about the core-libs-dev
mailing list