News for hackers. Stuff that matters.
Re:Java BitSet performance-flicker mystery by toomanydoubts on Saturday February 05, 2022 @06:07PM (#30227278)
Could it be that "0.5x" speed is actually 1x, and you're seeing your algorithm run at 2x sometimes on JDK8+ due to some optimization?

(Not a JVM user, so take with a grain of salt).

Re:Java BitSet performance-flicker mystery by cospaia on Saturday February 05, 2022 @06:16PM (#30227364)
Yes, 1X, 0.5X are a bit arbitrary. I mean 1X as the speed I know it can run at. So it could well be that with JDK7 the optimizations could not happen and that the question then is why the optimizations do not always happen.

Making each run longer, 1 minute instead of 5 seconds displays the same performance toggling:

0 - Passes: 72705, count: 78498, Valid: true 1 - Passes: 33140, count: 78498, Valid: true 2 - Passes: 71867, count: 78498, Valid: true 3 - Passes: 33137, count: 78498, Valid: true 4 - Passes: 72264, count: 78498, Valid: true 5 - Passes: 72062, count: 78498, Valid: true 6 - Passes: 33021, count: 78498, Valid: true 7 - Passes: 33053, count: 78498, Valid: true 8 - Passes: 71902, count: 78498, Valid: true 9 - Passes: 33024, count: 78498, Valid: true

(JDK17 in this case)

Re:Java BitSet performance-flicker mystery by nikanj on Sunday February 06, 2022 @03:24AM (#30230496)
I see you have a bright future in marketing: the actual facts didn’t change at all, but it now sounds twice as fast!