HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
dhartunian
1brcgo
Go2024–2024
dhartunian / 1brcgo

1brcgo

Discover this repository through its Hacker News conversations.

3Distinct people
3Mentions
0Explicit recommenders
38GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A public description has not been verified.

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 hour3 dated mentions

Observed mentions: 2024-03-03 07:27:46 UTC to 2024-03-03 18:07:30 UTC.

0122024-03-03 07:00:00 UTC to 2024-03-03 08:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 commentsMar 3, 07:002024-03-03 08:00:00 UTC to 2024-03-03 09:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-03-03 09:00:00 UTC to 2024-03-03 10:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-03-03 10:00:00 UTC to 2024-03-03 11:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-03-03 11:00:00 UTC to 2024-03-03 12:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-03-03 12:00:00 UTC to 2024-03-03 13:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsMar 3, 12:002024-03-03 13:00:00 UTC to 2024-03-03 14:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-03-03 14:00:00 UTC to 2024-03-03 15:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-03-03 15:00:00 UTC to 2024-03-03 16:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-03-03 16:00:00 UTC to 2024-03-03 17:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-03-03 17:00:00 UTC to 2024-03-03 18:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-03-03 18:00:00 UTC to 2024-03-03 19:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsMar 3, 18:00

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
Mar 3, 07:002024-03-03 07:00:00 UTC2024-03-03 08:00:00 UTC202
Mar 3, 08:002024-03-03 08:00:00 UTC2024-03-03 09:00:00 UTC000
Mar 3, 09:002024-03-03 09:00:00 UTC2024-03-03 10:00:00 UTC000
Mar 3, 10:002024-03-03 10:00:00 UTC2024-03-03 11:00:00 UTC000
Mar 3, 11:002024-03-03 11:00:00 UTC2024-03-03 12:00:00 UTC000
Mar 3, 12:002024-03-03 12:00:00 UTC2024-03-03 13:00:00 UTC000
Mar 3, 13:002024-03-03 13:00:00 UTC2024-03-03 14:00:00 UTC000
Mar 3, 14:002024-03-03 14:00:00 UTC2024-03-03 15:00:00 UTC000
Mar 3, 15:002024-03-03 15:00:00 UTC2024-03-03 16:00:00 UTC000
Mar 3, 16:002024-03-03 16:00:00 UTC2024-03-03 17:00:00 UTC000
Mar 3, 17:002024-03-03 17:00:00 UTC2024-03-03 18:00:00 UTC000
Mar 3, 18:002024-03-03 18:00:00 UTC2024-03-03 19:00:00 UTC101

What Hacker News says

3 sources
Your expectation is correct. The Java version is more tuned. Here https://github.com/dhartunian/1brcgo/?tab=readme-ov-file#lea..., you can find a version that runs in 1.108 and is almost 3x better than the one you quoted. I think one can reduce it even further. In the end, it depends on how fast the executable can boot up and execute the code. At some point, JVM will lose because it takes quite some time just to initialize the JVM, whereas Go executables can boot up very fast. Here you can see a comparison of Hello World Programs: https://github.com/qznc/hello-benchmark?tab=readme-ov-file#h.... JVM takes a whopping 596 ms to boot up and print Hello World, whereas Go just requires 149 ms.
In The One Billion Row Challenge in Go: from 1m45s to 4s in nine solutions
For anyone looking for more examples of 1BRC in Go, we had a friendly competition at work and collected the results here: https://github.com/dhartunian/1brcgo/ In addition to the loop-unrolling and bit-twiddling tricks that also show up in the fastest Java and C++ versions, some Go-specific things I learned were: - unsafe.Pointer can be used to read memory without bounds checks - many functions in the bytes and bits packages in the standard library are written in assembly - debug.SetGCPercent and SetMemoryLimit to turn off GC - runtime.LockOSThread to lock a goroutine to a thread - print is slightly faster than fmt.Printf (but writes to stderr)
In The One Billion Row Challenge in Go: from 1m45s to 4s in nine solutions

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.