gunnarmorling / 1brc

1️⃣🐝🏎️ The One Billion Row Challenge -- A fun exploration of how quickly 1B rows from a text file can be aggregated with Java
https://www.morling.dev/blog/one-billion-row-challenge/
Apache License 2.0
6k stars 1.8k forks source link

apply loop unroll trick #643

Closed abeobk closed 7 months ago

abeobk commented 7 months ago

Check List:

Benchmark 1: ./calculate_average_abeobk.sh Time (mean ± σ): 1.310 s ± 0.004 s [User: 0.002 s, System: 0.005 s] Range (min … max): 1.303 s … 1.318 s 10 runs

This version is faster on 8 threads (1.53s -> 1.31s), but slower than previous version on 36 threads (0.56s -> 0.627s)

gunnarmorling commented 7 months ago

Nice!

Benchmark 1: timeout -v 300 ./calculate_average_abeobk.sh 2>&1
  Time (mean ± σ):      1.964 s ±  0.016 s    [User: 0.002 s, System: 0.003 s]
  Range (min … max):    1.935 s …  1.973 s    5 runs

Summary
  abeobk: trimmed mean 1.9700661416200003, raw times 1.93466153562,1.9687762126200001,1.9683303976200002,1.97309181462,1.9733764866200003

Leaderboard

| # | Result (m:s.ms) | Implementation     | JDK | Submitter     | Notes     |
|---|-----------------|--------------------|-----|---------------|-----------|
|   | 00:01.970 | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_abeobk.java)| 21.0.2-graal | [Van Phu DO](https://github.com/abeobk) | GraalVM native binary, uses Unsafe |