Hacker GitHub

← All repos

dannyvankooten/1brc

View on GitHub ↗ ★ 106 C

C11 implementation of the 1 Billion Rows Challenge. 1️⃣🐝🏎️ Runs in ~1.6 seconds on my not-so-fast laptop CPU w/ 16GB RAM.

7 mentions on Hacker News by 4 people: 0 stories, 7 comments · first 2024-01-04 · latest 2024-04-14

Mentions per year 7 mentions · busiest year 2024 (7)
20082026
  1. There are some good ideas for this type of problem here: https://github.com/dannyvankooten/1brc After you deal with parsing and hashes, basically you are IO limited, so mmap helps. The C code takes less than 1.4s without any CUDA access.…
  2. c dominates every other language again... https://github.com/dannyvankooten/1brc#submitting
  3. …treatment (for ex. SIMD) to the C version (perhaps even adding some ASM) to see where we land. [1] https://github.com/dannyvankooten/1brc
  4. There’s an implementation in C which should run in well under 2 seconds on your M3. https://github.com/dannyvankooten/1brc
    comment by dvko · 2024-01-05 · in The One Billion Row Challenge
  5. You can run the bin/create-sample program from this C implementation here: https://github.com/dannyvankooten/1brc It’s just the city names + averages from the official repository using a normal distribution to generate 1B random rows.
    comment by dvko · 2024-01-04 · in The One Billion Row Challenge
  6. There are a handful of implementations in other languages already. Here’s mine in C99: https://github.com/dannyvankooten/1brc I’ve also seen versions in Rust, Go, Python, Clickhouse and DuckDB. The discussions tab on the GitHub repo lists…
    comment by dvko · 2024-01-04 · in The One Billion Row Challenge
  7. …structures) and then those aggregations are in turn aggregated when all threads have finished. 1: https://github.com/dannyvankooten/1brc
    comment by dvko · 2024-01-04 · in The One Billion Row Challenge