Hacker GitHub

← All repos

gunnarmorling/1brc

View on GitHub ↗ ★ 8,144 Java

1️⃣🐝🏎️ The One Billion Row Challenge -- A fun exploration of how quickly 1B rows from a text file can be aggregated with Java

41 mentions on Hacker News by 34 people: 2 stories, 39 comments · first 2024-01-02 · latest 2026-06-03

Mentions per year 41 mentions · busiest year 2024 (36)
20082026
  1. …decision make Java a faster or a slower language? That depends on how you look at performance. [1]: https://github.com/gunnarmorling/1brc
    comment by pron · 2026-06-03 · in Every Byte Matters
  2. …but with somewhat simpler statistics – though the core engineering challenges are very similar. https://github.com/gunnarmorling/1brc
    comment by SatvikBeri · 2025-12-16 · in In Defense of Matlab Code
  3. I'm working on a video / post on how to solve the 1 billion row challenge ( https://github.com/gunnarmorling/1brc ) and get a competitively fast result while keeping the code readable and maintainable. So far I'm within spitting distance…
    comment by makmanalp · 2025-11-09 · in Ask HN: What Are You Working On? (Nov 2025)
  4. Java is really fast: https://github.com/gunnarmorling/1brc
    comment by ludovicianul · 2025-09-17 · in Java 25 officially released
  5. …row aggregation challenge, especially the perfect hashing part, all the top entries all used it. https://github.com/gunnarmorling/1brc
  6. …and addition to combine the 1-3 digits via one multiplication, left-shift and mask operation. see https://github.com/gunnarmorling/1brc/blob/main/src/main/jav...
  7. …* Show & Tell, featuring implementations in languages other than Java: https://github.com/gunnarmorling/1brc/discussions/categories... * List of many more blog posts discussing 1BRC in different languages: https://github.com/gunn
  8. Java is very fast: https://github.com/gunnarmorling/1brc
  9. …be the code to beat. Ideally with only 8 cores but any number of cores is also very interesting. https://github.com/gunnarmorling/1brc/discussions/710
  10. …name and trademark for their implementation of smt, but the benchmark was run on an amd cpu) [0] https://github.com/gunnarmorling/1brc/issues/189#issuecommen...
    comment by fulafel · 2024-04-15 · in The One Billion Row Challenge in CUDA
  11. The 1brc benchmark has the data in a RAM disk[0], there's no disk IO. [0] https://github.com/gunnarmorling/1brc#evaluating-results
    comment by fulafel · 2024-04-14 · in The One Billion Row Challenge in CUDA
  12. …that they can compete with C/CPP performance - assuming you go out of your way to optimize for it. https://github.com/gunnarmorling/1brc
  13. Not being IO bound is part of the test design in this case. https://github.com/gunnarmorling/1brc?tab=readme-ov-file#eva... "Programs are run from a RAM disk (i.o. the IO overhead for loading the file from disk is not relevant)"
  14. …addition, the official 1BRC explicitly evaluated results on a RAM disk to avoid I/O speed entirely: https://github.com/gunnarmorling/1brc?tab=readme-ov-file#eva... "Programs are run from a RAM disk (i.o. the IO overhead for loading the…
  15. …(throwing away the next line), whereas the original adds it to a map and returns the next line. [1] https://github.com/gunnarmorling/1brc/blob/dfec2cdbe6a0334cf...
  16. …this like I do is wrong because they all run on different machines with different performances. 1. https://github.com/gunnarmorling/1brc/discussions/251#discus... 2. https://github.com/gunnarmorling/1brc/discussions/241#discus... 3.…
  17. There's the "Show & Tell", where folks have shared implementations in many different languages: https://github.com/gunnarmorling/1brc/discussions/categories... .
  18. Here’s a thread on results with duckdb, I don’t mean to discourage you taking a shot at all though: https://github.com/gunnarmorling/1brc/discussions/39
  19. If you are in “javaland” look at billion row challenge, you will learn a lot - https://github.com/gunnarmorling/1brc
  20. …rust solutions in the "Show and Tell" linked above, for example this fairly readable one at 15.5s: https://github.com/gunnarmorling/1brc/discussions/57 A comment above referencing Python "polars" actually has rust polars, std, and SIMD…
  21. For what it's worth, on my machine the simple/idiomatic "baseline" Java solution ( https://github.com/gunnarmorling/1brc/blob/main/src/main/jav... ) takes 2m0s, compared to 1m45s for my simple Go version. So Go is a bit better for the…
  22. On my machine the simple/idiomatic "baseline" Java solution ( https://github.com/gunnarmorling/1brc/blob/main/src/main/jav... ) takes 2m0s, compared to 1m45s for my simple Go version.
  23. Instructions on how to create it can be found here: https://github.com/gunnarmorling/1brc?tab=readme-ov-file#run... The Python version: https://github.com/gunnarmorling/1brc/blob/main/src/main/pyt...
  24. Rust: * https://github.com/gunnarmorling/1brc/discussions/57 * https://github.com/mtb0x1/1brc My friend also claims he is going to try it in Prolog. We'll see :)
  25. It depends on the machine, but some people got very fast results. https://github.com/gunnarmorling/1brc/discussions/57 Why would you use Javascript for that?
  26. …minutes written in java in 5 minutes. The official baseline is quite simple and runs in about ~3min https://github.com/gunnarmorling/1brc/blob/main/src/main/jav...
  27. …and stuff (even a Fortran solution that takes 3 seconds without going too far in optimization): https://github.com/gunnarmorling/1brc/discussions/categories... I like this discussion because while the original is about "what can you do in…
  28. …are winning because Unsafe lets them bypass bounds checks. The current fastest safe version: https://github.com/gunnarmorling/1brc/blob/main/src/main/jav...
  29. Link to the Git Repo for those that want to try the challenge: https://github.com/gunnarmorling/1brc/
  30. …CSV in just 2 seconds. In slow Java. It just requires some skills, which is hard to find nowadays. https://github.com/gunnarmorling/1brc
  31. …both C# and C++ blazing past it: https://hotforknowledge.com/2024/01/13/1brc-in-dotnet-among-... https://github.com/gunnarmorling/1brc/discussions/67
    comment by neonsunset · 2024-01-23 · in From slow to SIMD: A Go optimization story
  32. …been the change for a few entries that allowed getting below the 3-second barrier in the test. 1. https://github.com/gunnarmorling/1brc
  33. ▲ 4
    One billion row challenge in Python for Dask vs. Spark
    story by scj13 · 2024-01-16 · 0 comments
  34. …in RAM and not have to be read from disk. This gets the runtime down to 1.1s for this AMD 2950x ( https://github.com/gunnarmorling/1brc/discussions/46#discuss... ). With SIMD and certain assumptions about the input this can seemingly be…
    comment by dvko · 2024-01-06 · in The One Billion Row Challenge
  35. Look at the leaderboard for the fastest solutions https://github.com/gunnarmorling/1brc#results The fastest is currently at 12 seconds (not on M3 Pro though).
    comment by bufferoverflow · 2024-01-05 · in The One Billion Row Challenge
  36. It's all on GitHub Multiple languages: https://github.com/gunnarmorling/1brc/discussions My repo: https://github.com/buybackoff/1brc
    comment by buybackoff · 2024-01-04 · in The One Billion Row Challenge
  37. …to ensure there aren't hash collisions without doing a complete comparison between the names. [1] https://github.com/gunnarmorling/1brc/pull/56
    comment by spullara · 2024-01-04 · in The One Billion Row Challenge
  38. See the "Show & Tell", where folks are discussing solutions in different languages, including Rust: https://github.com/gunnarmorling/1brc/discussions/categories... .
    comment by gunnarmorling · 2024-01-04 · in The One Billion Row Challenge
  39. …wrong results if enough different cities are in the dataset. Or am I missing something? [0] https://github.com/gunnarmorling/1brc/blob/main/src/main/jav...
    comment by planb · 2024-01-04 · in The One Billion Row Challenge
  40. …looks like there are submissions in several languages. Go, Rust, Python, and C++, to name a few [0] https://github.com/gunnarmorling/1brc/discussions
    comment by kriskrunch · 2024-01-04 · in The One Billion Row Challenge
  41. ▲ 2
    The One Billion Row Challenge
    story by pagade · 2024-01-02 · 0 comments