3 ms·
Presenter of that talk here, very cool to see it being shared here. Running 1BRC was immensely fun, I learned a ton from it. Had you told me before how far the
by gunnarmorling 2y ago
Presenter of that talk here, very cool to see it being shared here.
Running 1BRC was immensely fun, I learned a ton from it. Had you told me before how far the community would be able to push this, I'd have not believed you.
One main take-away for me was that you could improve performance by one order of magnitude over the baseline basically by just doing a good job and avoiding basic mistakes. The resulting code is still well readable and maintainable. In most scenarios, this is where you should stop.
If you want to improve by another order of magnitude (like leaders in the challenge did), code becomes completely non-idiomatic, super-dense, and hard to maintain. You should go there only where it really, really matters, like when building a database kernel for instance. Or well, when trying to win a coding challenge ;)
Some more resources for those interested:
* Blog post with the results: https://www.morling.dev/blog/1brc-results-are-in/ https://www.morling.dev/blog/1brc-results-are-in/
* Show & Tell, featuring implementations in languages other than Java: https://github.com/gunnarmorling/1brc/discussions/categories/show-and-tell https://github.com/gunnarmorling/1brc/discussions/categories...
* List of many more blog posts discussing 1BRC in different languages: https://github.com/gunnarmorling/1brc?tab=readme-ov-file#1brc-on-the-web https://github.com/gunnarmorling/1brc?tab=readme-ov-file#1br...
* 3h deep-dive into the implementation techniques by Thomas Würthinger and Roy van Rijn, two of the top participants of the challenge: https://www.youtube.com/watch?v=_w4-BqeeC0k https://www.youtube.com/watch?v=_w4-BqeeC0k
- adeptima 2y agoAmazing! I've just asked few secs ago to share more posts discussing 1BRC in different languages, and here we go. Thank you!
- josephg 2y ago> One main take-away for me was that you could improve performance by one order of magnitude over the baseline basically by just doing a good job and avoiding basic mistakes. The resulting code is still well readable and maintainable. In most scenarios, this is where you should stop. I’ve done a lot of performance work but never heard this expressed so clearly before. Thanks - I’m stealing that. I’ve found exactly the same thing in my own work optimising text CRDTs. Just writing crdt code in a straightforward, correct way, without unnecessary allocations (and ideally using some good data structures) will get you very, very far. But there’s another order of magnitude available to anyone interested in using exotic, task specific data structures. I suspect the same is true in just about every field of computer science. Write good code in go / c# / Java / JavaScript / etc and 99% of the time, performance will be just fine. Well, so long as you don’t do anything silly like pull in immutablejs. But there’s usually 10-100x more performance available if you really try. If you want some examples, I highly recommend Algorithms for Modern Hardware, available for free online: https://en.algorithmica.org/hpc/ https://en.algorithmica.org/hpc/
- cookiengineer 2y agoThis was such a great challenge to follow. I learned a ton about different programming languages, their advantages and disadvantages, their idioms and paradigms. Overall this was just such a great event! Thanks for organizing it! (A silent observer)
- znpy 2y ago> basically by just doing a good job and avoiding basic mistakes. honest question: where would one go to learn what are the basic mistakes? any specific resource?