Tuning the JIT #187
Replies: 3 comments
-
I would love to see it! I'm surprised that this topic hasn't caught the community's attention yet. Being able to write a super JIT-friendly code would be the last possible push to increase the speed of our top solutions after all has been done like Unsafe, vectors, etc. What do you think? @gunnarmorling |
Beta Was this translation helpful? Give feedback.
-
Hey @chriswhocodes, sorry, only seeing this now, the last month has been crazy. I'd definitely love to learn more about this. I think for instance a blog post about this workflow for tuning @merykitty's or @serkan-ozal's JVM-based implementations would be very interesting to read. |
Beta Was this translation helpful? Give feedback.
-
Hi @gunnarmorling no worries, I think now the challenge is over and the entries are finished is a good time to see if any further JIT tuning is possible for the HotSpot entries. I'm not surprised that GraalVM native images are beating HotSpot on execution times this low and I don't expect CRaC-like tricks will be enough to mitigate the JVM's startup and warm-up costs. Great challenge, and I've loved some of the "Hacker's Delight" stuff people have come up with! |
Beta Was this translation helpful? Give feedback.
-
Hi @gunnarmorling is tuning the (HotSpot) JIT allowed under the rules (e.g. via $JAVA_OPTS) ?
I've been using JITWatch[1] to investigate the JIT behaviour of the implementations that use HotSpot C2 as the final tier JIT and have been able to improve them (including the fastest HotSpot solution from @merykitty) by 5-10%[2] by discovering where the JIT isn't able to apply certain optimisations under the default JVM settings and tuning the VM to enable the optimisation.
I won't submit tuning someone else's implementation as a solution 🤣 but I'm happy to demonstrate a tuning workflow here if this is within the spirit of the challenge?
In some cases the findings can suggest code-based solutions to maximise the JIT performance.
Congratulations on this great challenge and the heroic efforts needed to operate it!
Cheers,
Chris
[1] https://github.com/AdoptOpenJDK/jitwatch/releases/tag/1.4.9
[2] YMMV, tested on my machine: 12 cores i7-8700 CPU @ 3.20GHz, Linux 5.10.0-27-amd64, performance governor, 32G RAM
Beta Was this translation helpful? Give feedback.
All reactions