Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1BRC in Awk! #1

Open
glentner opened this issue Jan 23, 2024 · 2 comments
Open

1BRC in Awk! #1

glentner opened this issue Jan 23, 2024 · 2 comments

Comments

@glentner
Copy link

Clever implementations and aggressive parallelism have achieved incredible times, but I was curious what the naive, almost 1-liner in Awk would look like.

https://github.com/glentner/1brc-awk

I have found Awk to be wonderfully performant in a lot of these sorts of daily accumulation tasks, but in this case it's own internal associative array isn't too much faster than the naive implementation in something like Python. The equivalent, basic approach in something like Rust/C++ (no multi-threading, just HashMap/std::map and a struct) are 30% faster.

The redeeming quality here is the implementation took literally a minute with no compile step.

@jcbhmr
Copy link
Member

jcbhmr commented Jan 23, 2024

Awesome! 🤩 In only 12 lines too!
Are you accepting submissions from others that I can add a link to the website and the GitHub org readme to your repository? Do you want to add it to the @1brc org? This org is so far unofficial -- if you want to show this off to more people I highly recommend you share it on the current official discussion board too!

@glentner
Copy link
Author

I'm happy for folks to submit additional Awk implementations to my repo if that's what you mean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants