Closed jerrinot closed 7 months ago
It's actually a tad slower:
Benchmark 1: timeout -v 300 ./calculate_average_jerrinot.sh 2>&1
Time (mean ± σ): 2.445 s ± 0.046 s [User: 15.362 s, System: 0.798 s]
Range (min … max): 2.399 s … 2.513 s 5 runs
Summary
jerrinot: trimmed mean 2.4378531110533332, raw times 2.42589644272,2.3986416297199997,2.51291899172,2.41892198572,2.4687409047199997
Leaderboard
| # | Result (m:s.ms) | Implementation | JDK | Submitter | Notes |
|---|-----------------|--------------------|-----|---------------|-----------|
| | 00:02.437 | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_jerrinot.java)| 21.0.1-graal | [Jaromir Hamala](https://github.com/jerrinot) | uses Unsafe |
I believe the spawning trick isn't beneficial with the JVM (i.e. non-native binary).
Thanks for a super fast feedback! It was faster in my local testing. Well, worse things happen at sea😂
@gunnarmorling I pushed another commit - switching to AOT compilation. can you please give it another try? many thanks!
Yepp, looking better now :)
Benchmark 1: timeout -v 300 ./calculate_average_jerrinot.sh 2>&1
Time (mean ± σ): 2.149 s ± 0.012 s [User: 0.002 s, System: 0.004 s]
Range (min … max): 2.130 s … 2.169 s 10 runs
Summary
jerrinot: trimmed mean 2.14925808789, raw times 2.12968131914,2.14882771614,2.16860506514,2.14067246814,2.14426029714,2.14588217214,2.14475244114,2.15095327814,2.16637959914,2.15233673114
Leaderboard
| # | Result (m:s.ms) | Implementation | JDK | Submitter | Notes |
|---|-----------------|--------------------|-----|---------------|-----------|
| | 00:02.149 | [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 |
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: 3.4s
Execution time of reference implementation: long
the main change: Thomas's spawning trick. I shamelessly copy'n'pasted it directly from his code. there are a few other tweaks, most with a questionable value.