Congratulations to the Java Graal team on the outstanding showing at the 1 Billion Row Challenge!

Congratulations to the Java Graal team on the outstanding showing at the 1 Billion Row Challenge!

My heartiest congratulations to Dr. Thomas Wuerthinger and the entire GraalVM team on the incredible showing in the 1BRC — the 1 Billion Row Challenge, created by Gunnar Morling !

How did I miss this? I spent yesterday afternoon reading about all the wild innovations by so many talented people.

In short, the 31 day challenge was to write the fastest program to parse 1B rows of weather data, approx 14 GB of data. His goal was to see what was possible using modern Java (e.g., SIMD, GC, threading, etc.)

He created and enforced ground rules, with everyone committing code into a common repo, where it would be tested and timed.

He posted a naive baseline implementation, which took 4m 49s to run.

The contest blew up, with 164 submissions. But what is astonishing is that the winner, Thomas and his teammates, Quan Anh Mai and Alfonso Peterssen, completed in 1.5 seconds on 8 cores (0.3 sec on 32 cores)!

But what the Graal

team must be so proud of is all but two of the top 10 submissions were using Graal Native Images, and it looks like nearly half of the remaining submissions were using the Graal JIT — which makes sense, as it is a drop-in replacement for OpenJDK, etc.

I spent an hour reading the amazing analyses by Marko Topolnik and Marius Staicu . I'm going to pull the fun highlights from Marko's article: https://questdb.io/blog/billion-row-challenge-step-by-step/

  • naive baseline was 4:40
  • using parallel streams puts all CPUs to work: 71s
  • switch to GraalJIT: 66s
  • use three profilers, which he describes how each had a place in the quest to get to ~1s execution times — a great read!
  • parsing optimizations, getting rid of string operations, etc: 17s
  • manually parse ints: 11s
  • custom hash table (ha!): 6.6s
  • unsafe memory, wild SIMD parsing technique from Quan Anh Mai, and purging conditions from code: 2.4s
  • other magic: 1.8s
  • an amazing hack to reduce memory unmap time from Thomas and many more tricks to shave off every millisecond

My takeaways:

  • it's been decades since I've tried anything like this, but it's still fun to read all of the sheer cleverness being unleashed in this competition
  • many brains will almost always beat solitary brains — the information sharing between contestants, enabled by every submission encouraged lots of experimentation and spreading of great patterns (this was one of the key themes of "Wiring the Winning Organization" by Dr. Steve Spear and me.)
  • (I think we are seeing the same dynamic in the AI race, and we all benefited from the same dynamic in the race to find and distribute COVID vaccines.)
  • it was super cool to read about how people were getting massive speedups — the Java code looks more like C, but with none of the potential pointer shenanigans
  • as noted before, 8 of the top 10 submissions used native images, where startup time really mattered. However, astonishingly, the fourth place submission from Serkan ?zal used OpenJDK, with a time of 1.8s. (!!)
  • the promise of "write Java code, and the compiler will keep getting better and better and making it run faster" has been renewed — programs benefit from multiple JITs co-evolving, safely modularized by how the actual JVM runs (another topic in the WWO book, about how modularity creates independence of action and experimentation)

Kudos to all!

Links and resources:


Doguscan Namal

Software Development Engineer at Amazon Web Services

8 个月

Congrats Serkan ?zal for showing how powerful openjdk is ??

Robert Synofzik

Agilist (PSM II) with a knack for the technical side of Development (CKAD).

8 个月
Robert Synofzik

Agilist (PSM II) with a knack for the technical side of Development (CKAD).

8 个月
Johannes Lichtenberger

Software-Engineer bei awinia

8 个月

The Graal JIT compiler is amazing, I guess the better escape analysis in some of my tests make a huge difference :-)

Mahesh Mallikarjunaiah ↗?

Engineering Leader | Technology Transformation | SaaS | Cloud | DevOps | Innovation

8 个月

It is truly amazing to see all the work done Gene Kim

回复

要查看或添加评论,请登录

社区洞察

其他会员也浏览了