Can Java Beat the Rest? Inside the One‑Billion‑Row Benchmark Showdown
The article examines the One‑Billion‑Row benchmark challenge, showcasing a GraalVM‑powered Java solution and comparing its performance against dozens of languages—from C and Rust to Python and JavaScript—highlighting stark speed differences and the impact of AOT and JIT compilation techniques.
One‑Billion‑Row Benchmark Challenge
Gunnar Morling, a senior software engineer, launched a new programming challenge inviting developers to write a Java program that reads temperature measurements from a text file and computes the minimum, average and maximum temperature for each weather station.
The challenge is open globally until 31 January, with the repository at https://www.morling.dev/blog/one-billion-row-challenge/. The current fastest Java solution uses GraalVM CE 21 with ahead‑of‑time compilation, completing the task in 14.848 seconds on an AMD‑based cloud VM (8 vCPU, 32 GB RAM, Fedora 39).
How Java Stacks Up Against Other Languages
Participants submitted implementations in many languages, including Rust, C#, Go, Python, PostgreSQL, C, C++, and others. Notable results show a C program on an AMD laptop finishing in under 5 seconds, while a C# version on a Core i5 took 5.3 seconds.
Another benchmark by “attractive” covered 25 languages, focusing on raw language performance without library functions. It used intensive nested loops, integer arithmetic, matrix multiplication, and array accesses, and also solved the classic 15‑queen problem.
Key findings:
System‑level languages such as C and Rust are more than 50 times faster than interpreted languages like Python and Perl.
JIT languages (PHP, Ruby) fall between the two extremes.
AOT‑compiled languages (C#, Go, Swift, Zig) approach C‑level performance.
In a Sudoku‑style test, Java and C# run about twice as long as C/Rust but remain far ahead of Python or Ruby.
Among JavaScript runtimes, Bun is the fastest, Deno the slowest.
PyPy outperforms CPython by a large margin.
Despite its slower execution, Python remains one of the two most popular scripting languages, prompting speculation about whether any language will replace it in the next decade.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
