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

Revert original map to improve 10K #662

Closed artsiomkorzun closed 6 months ago

artsiomkorzun commented 7 months ago

Check List:

Reverting map structure to restore 10K performance.

gunnarmorling commented 6 months ago

No difference for the standard key set, but 10K key set is actually slower. Standard:

Benchmark 1: timeout -v 300 ./calculate_average_artsiomkorzun.sh 2>&1
  Time (mean ± σ):      1.924 s ±  0.015 s    [User: 0.001 s, System: 0.004 s]
  Range (min … max):    1.898 s …  1.935 s    5 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

Summary
  artsiomkorzun: trimmed mean 1.9286819972533333, raw times 1.8975089989200002,1.9284043529200001,1.9350505949200003,1.9297026599200002,1.92793897892

Leaderboard

| # | Result (m:s.ms) | Implementation     | JDK | Submitter     | Notes     |
|---|-----------------|--------------------|-----|---------------|-----------|
|   | 00:01.928 | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_artsiomkorzun.java)| 21.0.2-graal | [Artsiom Korzun](https://github.com/artsiomkorzun) | GraalVM native binary, uses Unsafe |

10K:

Benchmark 1: timeout -v 300 ./calculate_average_artsiomkorzun.sh 2>&1
  Time (mean ± σ):      3.179 s ±  0.022 s    [User: 0.001 s, System: 0.005 s]
  Range (min … max):    3.142 s …  3.198 s    5 runs

Summary
  artsiomkorzun: trimmed mean 3.1842617462133336, raw times 3.14171556288,3.19848109988,3.18802885388,3.1825212398800002,3.18223514488

Leaderboard

| # | Result (m:s.ms) | Implementation     | JDK | Submitter     | Notes     |
|---|-----------------|--------------------|-----|---------------|-----------|
|   | 00:03.184 | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_artsiomkorzun.java)| 21.0.2-graal | [Artsiom Korzun](https://github.com/artsiomkorzun) | GraalVM native binary, uses Unsafe |
artsiomkorzun commented 6 months ago

@gunnarmorling what time is for the current entry 29 Jan? I only see the time for 27 Jan.

artsiomkorzun commented 6 months ago

@gunnarmorling can you please test 413 case one more time? I picked up the compiler's setting from Thomas. Maybe something will change.

gunnarmorling commented 6 months ago

Yes, looking much better now:

Benchmark 1: timeout -v 300 ./calculate_average_artsiomkorzun.sh 2>&1
  Time (mean ± σ):      1.846 s ±  0.018 s    [User: 0.002 s, System: 0.003 s]
  Range (min … max):    1.815 s …  1.863 s    5 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

Summary
  artsiomkorzun: trimmed mean 1.8510420830066667, raw times 1.8148779293400001,1.8510192823400002,1.84887277834,1.86337728234,1.85323418834

Leaderboard

| # | Result (m:s.ms) | Implementation     | JDK | Submitter     | Notes     |
|---|-----------------|--------------------|-----|---------------|-----------|
|   | 00:01.851 | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_artsiomkorzun.java)| 21.0.2-graal | [Artsiom Korzun](https://github.com/artsiomkorzun) | GraalVM native binary, uses Unsafe |

Also back to the previous level for 10K.