Closed merykitty closed 6 months ago
- Spawning a separate process to hide the cost of unmapping: It is likely that the cost of initializing the VM is higher than the cost of unmap, I did not see improvements.
it seems there's another trick to try: https://github.com/gunnarmorling/1brc/blob/7f0e51781190bcfcd4b8624352230a19737b01c8/src/main/java/dev/morling/onebrc/CalculateAverage_serkan_ozal.java#L171-L176 along with https://github.com/gunnarmorling/1brc/blob/7f0e51781190bcfcd4b8624352230a19737b01c8/calculate_average_serkan-ozal.sh#L31-L35
Nice!
# | Result (m:s.ms) | Implementation | JDK | Submitter | Notes |
---|---|---|---|---|---|
00:02.367 | link | 21.0.1-open | Quan Anh Mai | uses Unsafe | |
00:03.210 | link | 21.0.1-open | Quan Anh Mai |
Hey @merykitty, couldn't find another way to reach out to you, so commenting here: would you perhaps be interested in teaming up with Thomas, Roy, Elliot, and me for doing a live stream on #1BRC tomorrow with Nicolai Parlog: https://twitter.com/gunnarmorling/status/1752288991909478611. As one of the fastest JVM-based implementations, it would be great to have your perspective on the challenge. Let me know :)
@gunnarmorling I would be more than happy to join. Can you give me more information regarding the subjects or what can I contribute to the conversation? My email is anhmdq99@gmail.com.
Perfect, I've added you to the DM chat with the other participants. Thanks a lot, looking forward to it!
Message ID: @.***>
Some small improvements:
min/max
Some that I have tried:
Unsafe
: Spawning a new segment each time introduces regression, most likely due to failures to inline even with that threshold of inlining, and using aLong.MAX_VALUE
-size segment introduces additional bound checks.Check List:
[x] You have run
./mvnw verify
and the project builds successfully[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
[x] 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: Cannot tell, my laptop is not really reliable for benchmarking, but the elapsed time is around 20s.
Execution time of the previous implementation: Around 26s.