News for hackers. Stuff that matters.
Re:Java BitSet performance-flicker mystery by mibsl on Saturday February 05, 2022 @06:54PM (#30227657)
Just a guess, but it kind of sounds like machine code loop alignment could be the cause. Modern CPUs really like their jump targets 32 byte aligned.
Re:Java BitSet performance-flicker mystery by rocketChair on Sunday February 06, 2022 @04:20AM (#30230786)
Aligned branch and jump targets are just for the sake of maximising instruction cache hit-rate. It will always remain a micro-optimisation and will not make a difference in this and most other cases.
Re:Java BitSet performance-flicker mystery by mibsl on Sunday February 06, 2022 @06:55AM (#30231718)
To maximize I$ hit rate you'd actually want to disable loop alignment to not inflate code size with padding.

Here's an example of unstable benchmark performance caused by the lack of code alignment in .NET's JIT: https://github.com/dotnet/runtime/issues/43227