HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
dannyvankooten
1brc
C2024–2024
dannyvankooten / 1brc

1brc

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

4Distinct people
7Mentions
0Explicit recommenders
106GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

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

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by week7 dated mentions

Observed mentions: 2024-01-04 18:10:28 UTC to 2024-04-14 13:12:27 UTC. Weeks start Monday, UTC.

0123452024-01-01 00:00:00 UTC to 2024-01-08 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 commentsJan 12024-01-08 00:00:00 UTC to 2024-01-15 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-15 00:00:00 UTC to 2024-01-22 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-22 00:00:00 UTC to 2024-01-29 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-29 00:00:00 UTC to 2024-02-05 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-05 00:00:00 UTC to 2024-02-12 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-12 00:00:00 UTC to 2024-02-19 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-19 00:00:00 UTC to 2024-02-26 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsFeb 192024-02-26 00:00:00 UTC to 2024-03-04 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-03-04 00:00:00 UTC to 2024-03-11 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-03-11 00:00:00 UTC to 2024-03-18 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-03-18 00:00:00 UTC to 2024-03-25 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-03-25 00:00:00 UTC to 2024-04-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-04-01 00:00:00 UTC to 2024-04-08 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-04-08 00:00:00 UTC to 2024-04-15 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsApr 8

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Jan 12024-01-01 00:00:00 UTC2024-01-08 00:00:00 UTC505
Jan 82024-01-08 00:00:00 UTC2024-01-15 00:00:00 UTC000
Jan 152024-01-15 00:00:00 UTC2024-01-22 00:00:00 UTC000
Jan 222024-01-22 00:00:00 UTC2024-01-29 00:00:00 UTC000
Jan 292024-01-29 00:00:00 UTC2024-02-05 00:00:00 UTC000
Feb 52024-02-05 00:00:00 UTC2024-02-12 00:00:00 UTC000
Feb 122024-02-12 00:00:00 UTC2024-02-19 00:00:00 UTC000
Feb 192024-02-19 00:00:00 UTC2024-02-26 00:00:00 UTC000
Feb 262024-02-26 00:00:00 UTC2024-03-04 00:00:00 UTC000
Mar 42024-03-04 00:00:00 UTC2024-03-11 00:00:00 UTC101
Mar 112024-03-11 00:00:00 UTC2024-03-18 00:00:00 UTC000
Mar 182024-03-18 00:00:00 UTC2024-03-25 00:00:00 UTC000
Mar 252024-03-25 00:00:00 UTC2024-04-01 00:00:00 UTC000
Apr 12024-04-01 00:00:00 UTC2024-04-08 00:00:00 UTC000
Apr 82024-04-08 00:00:00 UTC2024-04-15 00:00:00 UTC101

What Hacker News says

7 sources
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. Because there is no compute to speak of, other than parsing and a hashmap, a reasonable guess is that even for the optimal CUDA implementation, the starting of kernels and transfer of data to the GPU would likely add a noticeable bottleneck and make the optimal CUDA code slower than this pure C code.
In The One Billion Row Challenge in CUDA
Very fun challenge that nerd sniped me right away. Had to do a C version in standard C99 with POSIX threads. It[1] clocks in at just under 4 seconds on my AMD Ryzen 4800U Laptop CPU. Should run about 10-20% faster than that on the mentioned Hetzner hardware. - Since we only do one decimal of floating point precision it uses integer math right from the get-go. - FNV1-a hash with linear probing and a load factor well under 0.5. - Data file is mmap’d into memory. - Data is processed in 8 totally separate chunks (no concurrent data structures) and then those aggregations are in turn aggregated when all threads have finished. 1: https://github.com/dannyvankooten/1brc
In The One Billion Row Challenge

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.