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
5.69k stars 1.72k forks source link

CalculateAverage_stephenvonworley submission #677

Closed stephenvonworley closed 5 months ago

stephenvonworley commented 5 months ago

Hello, I'd like to make a new submission for the 1BRC! The class name is: CalculateAverage_stephenvonworley

prepare_stephenvonworley.sh uses Graal's native-image to generate a precompiled binary named CalculateAverage_stephenvonworley_image.

This solution is an optimized scalar parser, which combines most of the best ideas so far, plus some improvements of my own.

My code checks for hash collisions at lines 298, 318, and 323.

On 8 cores of a Xeon 2650 v3, the elapsed time is 2.18 seconds. Should run faster on your setup.

Thanks for putting this together, Gunnar! It must be a lot of work, I appreciate it.

Check List:

gunnarmorling commented 5 months ago

00:02.018.

gunnarmorling commented 5 months ago

Hey @stephenvonworley!

Congrats again on being in the Top 20 of the One Billion Row Challenge!

To celebrate this amazing achievement, I would like to send you a 1BRC t-shirt and coffee mug. To claim your prize, fill out this form by Feb 18. After submitting the form, please provide a comment with the random value you've specified in the form, so that I know it is you who submitted it.

All data entered will solely be used in relation to processing this shipment. Shipments can be sent to any country listed here or here (I'll use whichever one is cheaper for me to ship to your location). A big thank you to Decodable for sponsoring these prizes!

Thanks a lot for participating in 1BRC,

--Gunnar

stephenvonworley commented 5 months ago

Hey @stephenvonworley!

Congrats again on being in the Top 20 of the One Billion Row Challenge!

To celebrate this amazing achievement, I would like to send you a 1BRC t-shirt and coffee mug. To claim your prize, fill out this form by Feb 18. After submitting the form, please provide a comment with the random value you've specified in the form, so that I know it is you who submitted it.

All data entered will solely be used in relation to processing this shipment. Shipments can be sent to any country listed here or here (I'll use whichever one is cheaper for me to ship to your location). A big thank you to Decodable for sponsoring these prizes!

Thanks a lot for participating in 1BRC,

--Gunnar

Hi @gunnarmorling. Thanks a bunch for putting together the 1BRC, it was a lot of fun!

I never got the chance to optimize my inner loop: based on the solutions and some post-challenge experiments, I'm pretty sure there's a scalar Java implementation that runs in about 1.0 seconds on your 8 core test rig. I might code it up some time, just to find out...

Speaking of which, various people have had the idea of maintaining some solutions (scalar/vector, Unsafe/safe, etc) to which improvements could be submitted in ongoing fashion. If something like that ever happens, I'd be willing to pitch in to help manage it...

Once again, thanks! Steve 11444 28931