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
6.09k stars 1.83k forks source link

Small improvements #548

Closed artsiomkorzun closed 7 months ago

artsiomkorzun commented 8 months ago

Check List:

gunnarmorling commented 7 months ago

OH, wow:

Benchmark 1: timeout -v 300 ./calculate_average_artsiomkorzun.sh 2>&1
  Time (mean ± σ):      2.020 s ±  0.002 s    [User: 0.001 s, System: 0.004 s]
  Range (min … max):    2.016 s …  2.024 s    10 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 2.01961878996, raw times 2.0163513964599997,2.02158256246,2.01961824346,2.02362401246,2.01963217946,2.01981398246,2.01937850746,2.0193544704599997,2.01826585946,2.01930451446

Leaderboard

| # | Result (m:s.ms) | Implementation     | JDK | Submitter     | Notes     |
|---|-----------------|--------------------|-----|---------------|-----------|
|   | 00:02.019 | [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 |
jerrinot commented 7 months ago

this is amazing, congratz!

royvanrijn commented 7 months ago

Wow congrats, have you tried putting an else here?

https://github.com/gunnarmorling/1brc/blob/7a9b88f32891acd502710b9bbdfa72a260d088f4/src/main/java/dev/morling/onebrc/CalculateAverage_artsiomkorzun.java#L222-L224

If the value is lower than min, there is no way it's higher than max.

artsiomkorzun commented 7 months ago

@royvanrijn not yet, will try today.