Closed jerrinot closed 7 months ago
Yepp, makes for a small improvement:
Benchmark 1: timeout -v 300 ./calculate_average_jerrinot.sh 2>&1
Time (mean ± σ): 2.081 s ± 0.009 s [User: 0.002 s, System: 0.003 s]
Range (min … max): 2.066 s … 2.093 s 10 runs
Summary
jerrinot: trimmed mean 2.0812553498950006, raw times 2.0799817175200004,2.08734654252,2.0917138535200004,2.0754122445200003,2.0783476285200004,2.07593840552,2.0885443665200003,2.0657417345200004,2.09317634852,2.07275804052
Leaderboard
| # | Result (m:s.ms) | Implementation | JDK | Submitter | Notes |
|---|-----------------|--------------------|-----|---------------|-----------|
| | 00:02.081 | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_jerrinot.java)| 21.0.2-graal | [Jaromir Hamala](https://github.com/jerrinot) | GraalVM native binary, uses Unsafe |
@gunnarmorling: once more thanks for being so incredibly responsive!
Check List:
[x] Tests pass (
./test.sh <username>
shows no differences between expected and actual outputs)[x] All formatting changes by the build are committed
[x] Your launch script is named
calculate_average_<username>.sh
(make sure to match casing of your GH user name) and is executable[x] Output matches that of
calculate_average_baseline.sh
[ ] For new entries, or after substantial changes: When implementing custom hash structures, please point to where you deal with hash collisions (line number)
Execution time: 2.1s
Execution time of reference implementation: long
By far the biggest effect is again borrowed from Thomas:
-H:-GenLoopSafepoints
. I assume it emits safe points less frequently. Everything else is just a random change, fingers crossed and hope for the best.