Goal
Compute min/mean/max temperature per station over a one-billion-row text file, in Java, as fast as possible. The skill proved is JVM performance engineering as a measured discipline: profile, hypothesize, change one thing, measure again — from a 4-minute baseline down toward the leaderboard's sub-2-second range.
Subject: full brief & instructions
Practices
- Deep dive Java — JIT behavior, GC pressure, JFR/ async-profiler, virtual vs. platform threads: the internals, exercised under load.
- Performance engineering — measure-first methodology, mechanical sympathy, and the memory hierarchy deciding everything.
- Concurrency and Parallelism — data parallelism with a merge step, done by hand.
Milestones
- Baseline. Generate the 1B-row file with the repo's tooling; write the obvious
solution (
BufferedReader,String.split,HashMap). Record wall time — this number is your denominator. - Profile & fix the obvious. Run JFR or async-profiler; kill the top offenders —
splitand substring allocation, autoboxing of doubles,Stringkeys. Custom line parsing, primitive accumulators. Measure. - Go parallel. Split the file into chunks along newline boundaries, process per thread, merge the per-thread maps. Compare platform threads vs. virtual threads and understand why this workload doesn't care.
- Memory-map it.
MappedByteBuffer(or the FFM API), parse bytes directly — noStringuntil output, temperatures as scaled integers. Measure the drop. - Steal like an engineer. Read the top leaderboard entries — SWAR temperature parsing, branchless dispatch, custom open-addressing hash tables — port one technique at a time, and keep only what your measurements justify.
Stretch goals
- GraalVM native-image build; compare startup and peak against JIT.
- Port your fastest version to Go and Rust — Deep dive Go, Deep dive Rust — and write up who wins where and why.
Related
- Deep dive Java — the concept note whose
# Practicecites this. - One Billion Row Challenge — subject — the restated spec, measurement protocol, and acceptance checks.
- Performance engineering — the methodology this challenge drills end to end.