Home

Awesome

1️⃣🐝🏎️ The One Billion Row Challenge

Status Feb 4: The final leaderboards have been published. Congrats to all the winners, and a big thank you to everyone participating in this challenge as well as to everyone helping to organize it!

Status Feb 3: All entries have been evaluated and I am in the process of finalizing the leaderboards.

Status Feb 1: The challenge has been closed for new submissions. No new pull requests for adding submissions are accepted at this time. Pending PRs will be evaluated over the next few days.

Status Jan 31: The challenge will close today at midnight UTC.

Status Jan 12: As there has been such a large number of entries to this challenge so far (100+), and this is becoming hard to manage, please only create new submissions if you expect them to run in 10 seconds or less on the evaluation machine.

Status Jan 1: This challenge is open for submissions!

Sponsorship

A big thank you to my employer Decodable for funding the evaluation environment and supporting this challenge!

The One Billion Row Challenge (1BRC) is a fun exploration of how far modern Java can be pushed for aggregating one billion rows from a text file. Grab all your (virtual) threads, reach out to SIMD, optimize your GC, or pull any other trick, and create the fastest implementation for solving this task!

<img src="1brc.png" alt="1BRC" style="display: block; margin-left: auto; margin-right: auto; margin-bottom:1em; width: 50%;">

The text file contains temperature values for a range of weather stations. Each row is one measurement in the format <string: station name>;<double: measurement>, with the measurement value having exactly one fractional digit. The following shows ten rows as an example:

Hamburg;12.0
Bulawayo;8.9
Palembang;38.8
St. John's;15.2
Cracow;12.6
Bridgetown;26.9
Istanbul;6.2
Roseau;34.4
Conakry;31.2
Istanbul;23.0

The task is to write a Java program which reads the file, calculates the min, mean, and max temperature value per weather station, and emits the results on stdout like this (i.e. sorted alphabetically by station name, and the result values per station in the format <min>/<mean>/<max>, rounded to one fractional digit):

{Abha=-23.0/18.0/59.2, Abidjan=-16.2/26.0/67.3, Abéché=-10.0/29.4/69.0, Accra=-10.1/26.4/66.4, Addis Ababa=-23.7/16.0/67.0, Adelaide=-27.8/17.3/58.5, ...}

Submit your implementation by Jan 31 2024 and become part of the leaderboard!

Results

These are the results from running all entries into the challenge on eight cores of a Hetzner AX161 dedicated server (32 core AMD EPYC™ 7502P (Zen2), 128 GB RAM).

#Result (m:s.ms)ImplementationJDKSubmitterNotesCertificates
100:01.535link21.0.2-graalThomas Wuerthinger, Quan Anh Mai, Alfonso² PeterssenGraalVM native binary, uses UnsafeCertificate
200:01.587link21.0.2-graalArtsiom KorzunGraalVM native binary, uses UnsafeCertificate
300:01.608link21.0.2-graalJaromir HamalaGraalVM native binary, uses UnsafeCertificate
00:01.880link21.0.1-openSerkan ÖZALuses UnsafeCertificate
00:01.921link21.0.2-graalVan Phu DOGraalVM native binary, uses UnsafeCertificate
00:02.018link21.0.2-graalStephen Von WorleyGraalVM native binary, uses UnsafeCertificate
00:02.157link21.0.2-graalRoy van RijnGraalVM native binary, uses UnsafeCertificate
00:02.319link21.0.2-graalYavuz TasGraalVM native binary, uses UnsafeCertificate
00:02.332link21.0.2-graalMarko TopolnikGraalVM native binary, uses UnsafeCertificate
00:02.367link21.0.1-openQuan Anh Maiuses UnsafeCertificate
00:02.507link21.0.1-opengonixuses UnsafeCertificate
00:02.557link21.0.1-openyourwassuses UnsafeCertificate
00:02.820link22.ea.32-openLi Linuses UnsafeCertificate
00:02.995link21.0.2-graaltivrfoaGraalVM native binary, uses UnsafeCertificate
00:02.997link21.0.1-opengonixCertificate
00:03.095link21.0.2-graalJamal MullaGraalVM native binary, uses UnsafeCertificate
00:03.210link21.0.1-openQuan Anh MaiCertificate
00:03.298link21.0.1-graalSubrahmanyamuses UnsafeCertificate
00:03.431link21.0.1-graalRoman MusinGraalVM native binary, uses UnsafeCertificate
00:03.469link21.0.2-graalElliot BarlasGraalVM native binary, uses UnsafeCertificate
00:03.698link21.0.1-graalJason NochlinCertificate
00:03.785link21.0.2-graalzerninvGraalVM native binary, uses UnsafeCertificate
00:03.820link21.0.2-graalJohn ZiamosGraalVM native binary, uses UnsafeCertificate
00:03.902link21.0.1-openJuan PareraCertificate
00:03.966link21.0.1-openJin Cong Houses UnsafeCertificate
00:03.991link21.0.1-graalVaidhy Mayilrangamuses UnsafeCertificate
00:04.066link21.0.1-openJesseVanRooyuses UnsafeCertificate
00:04.101link21.0.2-graalJaime PoliduraGraalVM native binary, uses UnsafeCertificate
00:04.209link21.0.1-openGiovanni CuccuCertificate
00:04.474link21.0.1-openRoman StoffelCertificate
00:04.676link21.0.2-temPeter LevartCertificate
00:04.684link21.0.1-openFlorin Blanaruuses UnsafeCertificate
00:04.701link21.0.1-openDr Ian PrestonCertificate
00:04.741link21.0.1-openCliff Clickuses UnsafeCertificate
00:04.800link21.0.1-openParker TimminsCertificate
00:04.884link21.0.1-openAleksey ShipilëvCertificate
00:04.920link21.0.1-graalSubrahmanyamCertificate
00:05.077link21.0.2-graalJonathan WrightGraalVM native binary, uses UnsafeCertificate
00:05.142link21.0.1-openArjen WisseCertificate
00:05.167link21.0.2-openYevhenii MelnykCertificate
00:05.235link21.0.1-openunboundedCertificate
00:05.336linkjavaSumit Chaudharyuses UnsafeCertificate
00:05.354link21.0.2-graalArman SharifGraalVM native binary, uses UnsafeCertificate
00:05.478link21.0.1-openOlivier Bourgainuses UnsafeCertificate
00:05.559link21.0.1-graalPanagiotis DrakatosGraalVM native binaryCertificate
00:05.887link21.0.1-graalCharlie Evansuses UnsafeCertificate
00:05.979link21.0.1-graalSam PullaraCertificate
00:06.166link21.0.1-openJamie StansfieldCertificate
00:06.257link21.0.1-graalStefan Sprengeruses UnsafeCertificate
00:06.392link21.0.2-graalDiego ParraCertificate
00:06.576link21.0.1-openAndrew Sunuses UnsafeCertificate
00:06.635link21.0.1-graalLaake Scates-GervasiGraalVM native binary, uses UnsafeCertificate
00:06.654link21.0.1-graalJaroslav BachorikCertificate
00:06.715link21.0.1-openAlgirdas RaščiusCertificate
00:06.884link21.0.1-graalrcasteltrioneCertificate
00:06.982link21.0.1-openChris BellewCertificate
00:07.563link21.0.1-graal3j5aCertificate
00:07.680link21.0.1-graalXylitoluses UnsafeCertificate
00:07.712link21.0.1-graalAnita SVCertificate
00:07.730link21.0.1-openJohannes SchüthCertificate
00:07.894link21.0.2-temAntonio MuñozCertificate
00:07.925link21.0.1-graalRicardo PieperCertificate
00:07.948linkjavaSmoofieuses UnsafeCertificate
00:08.157link21.0.1-openJurenIvanCertificate
00:08.167link21.0.1-temDimitar DimitrovCertificate
00:08.214link21.0.1-opendeemkeenCertificate
00:08.255link21.0.1-openMathias BjerkeCertificate
00:08.398link21.0.1-openParth Mudgaluses UnsafeCertificate
00:08.489link21.0.1-graalBang NGUYENCertificate
00:08.517link21.0.1-graalagsuses UnsafeCertificate
00:08.557link21.0.1-graalAdrià CabezaCertificate
00:08.622link21.0.1-graalKeshavram Kuduwauses UnsafeCertificate
00:08.892link21.0.1-openRoman RomanchukCertificate
00:08.896link21.0.1-openAndrzej NestorukCertificate
00:09.020link21.0.1-openyemreinciCertificate
00:09.071link21.0.1-openGabriel ReidCertificate
00:09.352link21.0.1-graalFilip HrisafovCertificate
00:09.725link21.0.2-graalMartinGraalVM native binaryCertificate
00:09.867link21.0.1-graalRicardo PieperCertificate
00:09.945link21.0.1-openAnthony GoubardCertificate
00:10.092link21.0.1-graalPrathamCertificate
00:10.127link21.0.1-openParth Mudgaluses UnsafeCertificate
00:11.577link21.0.1-openEveCertificate
00:10.473link21.0.1-openAnton RybochkinCertificate
00:11.119link21.0.1-openlawreyCertificate
00:11.156linkjavaYann MoisanCertificate
00:11.167link21.0.1-openNick PalmerCertificate
00:11.352link21.0.1-openkarthikeyan97uses UnsafeCertificate
00:11.363link21.0.2-temGuruprasad SridharanCertificate
00:11.405link21.0.1-graalRafael Merino GarcíaCertificate
00:11.406link21.0.1-graalgabrielfooCertificate
00:11.433link21.0.1-graalJatin GalaCertificate
00:11.505link21.0.1-openDmitry Bufistovuses UnsafeCertificate
00:11.744link21.0.2-temSebastian LövdahlCertificate
00:11.805link21.0.1-graalCool_MinemanCertificate
00:11.934link21.0.1-openarjenvaneerdeCertificate
00:12.220link21.0.1-openRichard StartinCertificate
00:12.495link21.0.1-graalSamuel YvonGraalVM native binaryCertificate
00:12.568link21.0.1-graalVladCertificate
00:12.800linkjavaYonatan GraberCertificate
00:13.013link21.0.1-graalThanh DuongCertificate
00:13.071link21.0.1-openDr Ian PrestonCertificate
00:13.729linkjavaCedric BoesCertificate
00:13.817link21.0.1-openCarloCertificate
00:14.502link21.0.1-graaleriklummeCertificate
00:14.772link21.0.1-openKevin McMurtrieCertificate
00:14.867link21.0.1-openMichael BerryCertificate
00:14.900linkjavaJudekeyserCertificate
00:15.006linkjavaPaweł AdamskiCertificate
00:15.662link21.0.1-openSerghei MotpanCertificate
00:16.063link21.0.1-openMarek KohnCertificate
00:16.457link21.0.1-openAlekseiCertificate
00:16.953link21.0.1-openGaurav Anantrao DeshmukhCertificate
00:17.046link21.0.1-openDimitris KarampinasCertificate
00:17.086linkjavaBreejesh RathodCertificate
00:17.490link21.0.1-openGergely KissCertificate
00:17.255link21.0.1-opentkosachevCertificate
00:17.520link21.0.1-openFaridCertificate
00:17.717link21.0.1-openOleh MarchenkoCertificate
00:17.815link21.0.1-openHallvard TrættebergCertificate
00:17.932link21.0.1-openBartłomiej PietrzykCertificate
00:18.251link21.0.1-graalMarkus EbnerCertificate
00:18.448link21.0.1-openMoysés Borges FurtadoCertificate
00:18.771link21.0.1-graalDavid KopecCertificate
00:18.902link21.0.1-graalMaximeCertificate
00:19.357link21.0.1-graalceRoman SchweitzerCertificate
00:20.691link21.0.1-graalKidlikeGraalVM native binaryCertificate
00:21.989link21.0.1-opencourageleeCertificate
00:22.188link21.0.1-openJairo GraterónCertificate
00:22.334link21.0.1-openAlberto VenturiniCertificate
00:22.457link21.0.1-openRamzi Ben YahyaCertificate
00:22.471link21.0.1-openShivam AgarwalCertificate
00:24.986link21.0.1-openkumarsaurav123Certificate
00:25.064link21.0.2-openSudhir TumatiCertificate
00:26.500link21.0.1-openBruno FélixCertificate
00:28.381link21.0.1-openHampusCertificate
00:29.741link21.0.1-openMatteo VaccariCertificate
00:32.018link21.0.1-openAurelian TutuianuCertificate
00:34.388link21.0.1-temTobiCertificate
00:35.875link21.0.1-openMahmoudFawzyKhalilCertificate
00:36.180link21.0.1-openHoria ChioreanCertificate
00:36.424linkjavaManish GargCertificate
00:38.340link21.0.1-openAbstractKamenCertificate
00:41.982link21.0.1-openChris RiccominiCertificate
00:42.893link21.0.1-openjavamakCertificate
00:46.597link21.0.1-openMaeda-sanCertificate
00:58.811link21.0.1-openUjjwal BhartiCertificate
01:05.094link21.0.1-openMudit SaxenaCertificate
01:05.979link21.0.1-graalHieu Dao QuangCertificate
01:06.790link21.0.1-openKarl Heinz MarbaiseCertificate
01:06.944link21.0.1-opensantanuCertificate
01:07.014link21.0.1-openpedestrianloveCertificate
01:07.101link21.0.1-openJeevjyot Singh ChhabdaCertificate
01:08.811link21.0.1-openAleš JustinCertificate
01:08.908link21.0.1-openitaskeCertificate
01:09.595link21.0.1-temAntonio GoncalvesCertificate
01:09.882link21.0.1-openPrabhu RCertificate
01:14.815link21.0.1-opentwohardthingsCertificate
01:25.801link21.0.1-openivanklaricCertificate
01:33.594link21.0.1-openGaurav MathurCertificate
01:53.208linkjavaMahadev KCertificate
01:56.607link21.0.1-openAbhilashCertificate
03:43.521link21.0.1-open김예환 Ye-Hwan Kim (Sam)Certificate
03:59.760link21.0.1-openSamsonCertificate
---
04:49.679link (Baseline)21.0.1-openGunnar Morling

Note that I am not super-scientific in the way I'm running the contenders (see Evaluating Results for the details). This is not a high-fidelity micro-benchmark and there can be variations of up to +-3% between runs. So don't be too hung up on the exact ordering of your entry compared to others in close proximity. The primary purpose of this challenge is to learn something new, have fun along the way, and inspire others to do the same. The leaderboard is only means to an end for achieving this goal. If you observe drastically different results though, please open an issue.

See Entering the Challenge for instructions how to enter the challenge with your own implementation. The Show & Tell features a wide range of 1BRC entries built using other languages, databases, and tools.

Bonus Results

This section lists results from running the fastest N entries with different configurations. As entries have been optimized towards the specific conditions of the original challenge description and set-up (such as size of the key set), challenge entries may perform very differently across different configurations. These bonus results are provided here for informational purposes only. For the 1BRC challenge, only the results in the previous section are of importance.

32 Cores / 64 Threads

For officially evaluating entries into the challenge, each contender is run on eight cores of the evaluation machine (AMD EPYC™ 7502P). Here are the results from running the top 50 entries (as of commit e1fb378a, Feb 2) on all 32 cores / 64 threads (i.e. SMT is enabled) of the machine:

#Result (m:s.ms)ImplementationJDKSubmitterNotes
100:00.323link21.0.2-graalJaromir HamalaGraalVM native binary, uses Unsafe
200:00.326link21.0.2-graalThomas Wuerthinger, Quan Anh Mai, Alfonso² PeterssenGraalVM native binary, uses Unsafe
300:00.349link21.0.2-graalArtsiom KorzunGraalVM native binary, uses Unsafe
00:00.351link21.0.2-graalVan Phu DOGraalVM native binary, uses Unsafe
00:00.389link21.0.2-graalStephen Von WorleyGraalVM native binary, uses Unsafe
00:00.408link21.0.2-graalYavuz TasGraalVM native binary, uses Unsafe
00:00.415link21.0.2-graalRoy van RijnGraalVM native binary, uses Unsafe
00:00.499link21.0.2-graalMarko TopolnikGraalVM native binary, uses Unsafe
00:00.602link21.0.1-graalRoman MusinGraalVM native binary, uses Unsafe
00:00.623link21.0.1-opengonixuses Unsafe
00:00.710link21.0.2-graalJamal MullaGraalVM native binary, uses Unsafe
00:00.727link21.0.2-graaltivrfoaGraalVM native binary, uses Unsafe
00:00.774link21.0.1-openSerkan ÖZALuses Unsafe
00:00.788link21.0.2-graalElliot BarlasGraalVM native binary, uses Unsafe
00:00.832link21.0.2-graalzerninvGraalVM native binary, uses Unsafe
00:00.840link21.0.1-opengonix
00:00.857link21.0.2-graalJaime PoliduraGraalVM native binary, uses Unsafe
00:00.880link21.0.2-graalJohn ZiamosGraalVM native binary, uses Unsafe
00:00.939link21.0.1-openAleksey Shipilëv
00:01.026link21.0.1-openJesseVanRooyuses Unsafe
00:01.118link21.0.2-graalJonathan WrightGraalVM native binary
00:01.140link21.0.2-graalArman SharifGraalVM native binary, uses Unsafe
00:01.143link21.0.1-openCliff Clickuses Unsafe
00:01.169link21.0.2-openYevhenii Melnyk
00:01.188link21.0.1-graalSubrahmanyamuses Unsafe
00:01.193link21.0.1-openFlorin Blanaruuses Unsafe
00:01.234link21.0.1-openOlivier Bourgainuses Unsafe
00:01.242link21.0.1-openQuan Anh Maiuses Unsafe
00:01.252link21.0.1-openJin Cong Houses Unsafe
00:01.267link22.ea.32-openLi Linuses Unsafe
00:01.363link21.0.2-temPeter Levart
00:01.380link21.0.1-graalJason Nochlin
00:01.391link21.0.1-openQuan Anh Mai
00:01.439link21.0.1-openArjen Wisse
00:01.446link21.0.1-openDr Ian Preston
00:01.504link21.0.1-openJamie Stansfield
00:01.514link21.0.1-graalSubrahmanyam
00:01.516link21.0.1-graalVaidhy Mayilrangamuses Unsafe
00:01.586link21.0.1-openyourwassuses Unsafe
00:01.647link21.0.2-graalDiego Parra
00:01.694link21.0.1-openParker Timmins
00:01.694link21.0.1-graalCharlie Evansuses Unsafe
00:01.702link21.0.1-graalSam Pullara
00:01.733linkjavaSumit Chaudharyuses Unsafe
00:01.742link21.0.1-openunbounded
00:02.241link21.0.1-graalStefan Sprengeruses Unsafe
00:02.294link21.0.1-openGiovanni Cuccu
00:02.990link21.0.1-graalPanagiotis DrakatosGraalVM native binary
00:03.205link21.0.1-openJuan Parera
00:10.929link21.0.1-openRoman Stoffel

10K Key Set

The 1BRC challenge data set contains 413 distinct weather stations, whereas the rules allow for 10,000 different station names to occur. Here are the results from running the top 40 entries (as of commit e1fb378a, Feb 2) against 1,000,000,000 measurement values across 10K stations (created via ./create_measurements3.sh 1000000000), using eight cores on the evaluation machine:

#Result (m:s.ms)ImplementationJDKSubmitterNotes
100:02.957link21.0.2-graalArtsiom KorzunGraalVM native binary, uses Unsafe
200:03.058link21.0.2-graalMarko TopolnikGraalVM native binary, uses Unsafe
300:03.186link21.0.2-graalStephen Von WorleyGraalVM native binary, uses Unsafe
00:03.998link21.0.2-graalRoy van RijnGraalVM native binary, uses Unsafe
00:04.042link21.0.2-graalJaromir HamalaGraalVM native binary, uses Unsafe
00:04.289link21.0.1-opengonixuses Unsafe
00:04.522link21.0.2-graaltivrfoaGraalVM native binary, uses Unsafe
00:04.653link21.0.2-graalJamal MullaGraalVM native binary, uses Unsafe
00:04.733link21.0.1-opengonix
00:04.836link21.0.1-graalSubrahmanyamuses Unsafe
00:04.870link21.0.2-graalThomas Wuerthinger, Quan Anh Mai, Alfonso² PeterssenGraalVM native binary, uses Unsafe
00:05.240link21.0.2-graalzerninvGraalVM native binary, uses Unsafe
00:05.394link21.0.2-graalYavuz TasGraalVM native binary, uses Unsafe
00:05.906link21.0.2-graalElliot BarlasGraalVM native binary, uses Unsafe
00:06.086link21.0.2-graalVan Phu DOGraalVM native binary, uses Unsafe
00:06.379link21.0.2-graalJohn ZiamosGraalVM native binary, uses Unsafe
00:07.113link21.0.2-openYevhenii Melnyk
00:07.542link21.0.2-graalJonathan WrightGraalVM native binary
00:07.889link21.0.1-openFlorin Blanaruuses Unsafe
00:07.970link21.0.1-openCliff Clickuses Unsafe
00:08.857link21.0.1-openSerkan ÖZAL
00:09.333link21.0.1-openyourwassuses Unsafe
00:09.722link21.0.1-openAleksey Shipilëv
00:09.777link21.0.1-graalVaidhy Mayilrangamuses Unsafe
00:10.263link21.0.1-openQuan Anh Maiuses Unsafe
00:11.154link21.0.1-openParker Timmins
00:13.175link21.0.1-openQuan Anh Mai
00:13.245link21.0.1-openDr Ian Preston
00:13.377link21.0.1-openGiovanni Cuccu
00:13.761link21.0.1-openJuan Parera
00:14.441link21.0.2-temPeter Levart
00:15.548link21.0.1-openJin Cong Houses Unsafe
00:17.906link21.0.1-graalJason Nochlin
00:18.770link22.ea.32-openLi Linuses Unsafe
00:19.106link21.0.1-openRoman Stoffel
00:20.151link21.0.1-graalRoman MusinGraalVM native binary, uses Unsafe; seg-faults occassionally
00:22.953link21.0.2-graalJaime PoliduraGraalVM native binary, uses Unsafe
---
DNFlink21.0.1-openJesseVanRooyIncorrect output
DNFlink21.0.1-graalSubrahmanyamDoesn't complete in 60 sec
DNFlink21.0.1-openArjen WisseIncorrect output

Prerequisites

Java 21 must be installed on your system.

Running the Challenge

This repository contains two programs:

Execute the following steps to run the challenge:

  1. Build the project using Apache Maven:

    ./mvnw clean verify
    
  2. Create the measurements file with 1B rows (just once):

    ./create_measurements.sh 1000000000
    

    This will take a few minutes. Attention: the generated file has a size of approx. 12 GB, so make sure to have enough diskspace.

    If you're running the challenge with a non-Java language, there's a non-authoritative Python script to generate the measurements file at src/main/python/create_measurements.py. The authoritative method for generating the measurements is the Java program dev.morling.onebrc.CreateMeasurements.

  3. Calculate the average measurement values:

    ./calculate_average_baseline.sh
    

    The provided naive example implementation uses the Java streams API for processing the file and completes the task in ~2 min on environment used for result evaluation. It serves as the base line for comparing your own implementation.

  4. Optimize the heck out of it:

    Adjust the CalculateAverage program to speed it up, in any way you see fit (just sticking to a few rules described below). Options include parallelizing the computation, using the (incubating) Vector API, memory-mapping different sections of the file concurrently, using AppCDS, GraalVM, CRaC, etc. for speeding up the application start-up, choosing and tuning the garbage collector, and much more.

Flamegraph/Profiling

A tip is that if you have jbang installed, you can get a flamegraph of your program by running async-profiler via ap-loader:

jbang --javaagent=ap-loader@jvm-profiling-tools/ap-loader=start,event=cpu,file=profile.html -m dev.morling.onebrc.CalculateAverage_yourname target/average-1.0.0-SNAPSHOT.jar

or directly on the .java file:

jbang --javaagent=ap-loader@jvm-profiling-tools/ap-loader=start,event=cpu,file=profile.html src/main/java/dev/morling/onebrc/CalculateAverage_yourname

When you run this, it will generate a flamegraph in profile.html. You can then open this in a browser and see where your program is spending its time.

Rules and limits

Entering the Challenge

To submit your own implementation to 1BRC, follow these steps:

Note: I reserve the right to not evaluate specific submissions if I feel doubtful about the implementation (I.e. I won't run your Bitcoin miner ;).

If you'd like to discuss any potential ideas for implementing 1BRC with the community, you can use the GitHub Discussions of this repository. Please keep it friendly and civil.

The challenge runs until Jan 31 2024. Any submissions (i.e. pull requests) created after Jan 31 2024 23:59 UTC will not be considered.

Evaluating Results

Results are determined by running the program on a Hetzner AX161 dedicated server (32 core AMD EPYC™ 7502P (Zen2), 128 GB RAM).

Programs are run from a RAM disk (i.o. the IO overhead for loading the file from disk is not relevant), using 8 cores of the machine. Each contender must pass the 1BRC test suite (/test.sh). The hyperfine program is used for measuring execution times of the launch scripts of all entries, i.e. end-to-end times are measured. Each contender is run five times in a row. The slowest and the fastest runs are discarded. The mean value of the remaining three runs is the result for that contender and will be added to the results table above. The exact same measurements.txt file is used for evaluating all contenders. See the script evaluate.sh for the exact implementation of the evaluation steps.

Prize

If you enter this challenge, you may learn something new, get to inspire others, and take pride in seeing your name listed in the scoreboard above. Rumor has it that the winner may receive a unique 1️⃣🐝🏎️ t-shirt, too!

FAQ

Q: Can I use Kotlin or other JVM languages other than Java?
A: No, this challenge is focussed on Java only. Feel free to inofficially share implementations significantly outperforming any listed results, though.

Q: Can I use non-JVM languages and/or tools?
A: No, this challenge is focussed on Java only. Feel free to inofficially share interesting implementations and results though. For instance it would be interesting to see how DuckDB fares with this task.

Q: I've got an implementation—but it's not in Java. Can I share it somewhere?
A: Whilst non-Java solutions cannot be formally submitted to the challenge, you are welcome to share them over in the Show and tell GitHub discussion area.

Q: Can I use JNI?
A: Submissions must be completely implemented in Java, i.e. you cannot write JNI glue code in C/C++. You could use AOT compilation of Java code via GraalVM though, either by AOT-compiling the entire application, or by creating a native library (see here.

Q: What is the encoding of the measurements.txt file?
A: The file is encoded with UTF-8.

Q: Can I make assumptions on the names of the weather stations showing up in the data set?
A: No, while only a fixed set of station names is used by the data set generator, any solution should work with arbitrary UTF-8 station names (for the sake of simplicity, names are guaranteed to contain no ; or \n characters).

Q: Can I copy code from other submissions?
A: Yes, you can. The primary focus of the challenge is about learning something new, rather than "winning". When you do so, please give credit to the relevant source submissions. Please don't re-submit other entries with no or only trivial improvements.

Q: Which operating system is used for evaluation?
A: Fedora 39.

Q: My solution runs in 2 sec on my machine. Am I the fastest 1BRC-er in the world?
A: Probably not :) 1BRC results are reported in wallclock time, thus results of different implementations are only comparable when obtained on the same machine. If for instance an implementation is faster on a 32 core workstation than on the 8 core evaluation instance, this doesn't allow for any conclusions. When sharing 1BRC results, you should also always share the result of running the baseline implementation on the same hardware.

Q: Why 1️⃣🐝🏎️ ?
A: It's the abbreviation of the project name: One Billion Row Challenge.

1BRC on the Web

A list of external resources such as blog posts and videos, discussing 1BRC and specific implementations:

License

This code base is available under the Apache License, version 2.

Code of Conduct

Be excellent to each other! More than winning, the purpose of this challenge is to have fun and learn something new.