- One Billion Rows Challenge: Java Optimization Journey - From 5 mins to 320 ms!Faculty of Informatics Masaryk University, Brno-Královo Pole-Ponava
Speaker: Jaromír Hamala (@jerrinot, QuestDB)
On January 1, 2024, Gunnar Morling announced an online challenge: "How fast can YOU aggregate 1B rows using modern #Java? Grab your threads, flex your SIMD, and kick off 2024 true coder style by joining this friendly little competition. Submissions accepted until Jan 31."
The challenge quickly became massively popular. The repository quickly gained over 3,000 GitHub stars and more than 1,000 forks. Some of the best-known names in the Java performance space joined. I also joined the challenge and had more way fun than originally thought. I managed to win bronze in the main competition and gold in a category for 32 CPU cores.
The reference idiomatic Java solution processes the input in 5 minutes. The winning program finishes in 1.5 seconds on an 8-core CPU, and my program runs in just 320 milliseconds on a 32-core CPU.
In this talk, I will guide you through the tricks applied by most of the fastest solutions: Zero GC coding, the effects of branch-free algorithms, Ahead of Time compilation, SIMD Within A Register techniques, and even tricks to speed up exit(). I will show you not just the effect of these tricks on the total execution time, but we will also use perf and other tools to understand what is happening inside a CPU.
This will be a blast. The organizers also had a lot of fun with the 1BRC during January, and we can be really proud that we have one of the winners in our group!
You can find the 1BRC here - https://github.com/gunnarmorling/1brc.
After the talk, we will have the after-party as usual.