This challenge has been doing the rounds recently: https://www.morling.dev/blog/one-billion-row-challenge/
(the criteria is for submissions in Java, but no harm in attempting it in Go ๐ )
I just wanted to ask for feedback from more experienced engineers about how you would approach optimising this using Go.
I have a basic/naive approach that tries to minimise allocations, but really it's just reading straight through the file and keeping the data in a map synchronously.
What would be a good way to leverage concurrency to speed this up?
From my understanding
- you could perhaps use fixed worker pool of goroutines that can process the data as it comes off the file?
i'm just struggling with the best way to approach the problem and getting tripped up on my own feet trying to create some crazy ad-hoc concurrency patterns ๐ฅด
Update Jan 4: Wow, this thing really took off!
1BRC is discussed at a couple of places on the internet, including Hacker News, lobste.rs, and Reddit.
For folks to show-case non-Java solutions, there is a "Show & Tell" now, check that one out for 1BRC implementations in Rust, Go, C++, and others.
Some interesting related write-ups include 1BRC...
