Giter Club home page Giter Club logo

1brc's Introduction

One Billion Row Challenge

Okay, let's do this.

Round 1

Time Command
13.191s dotnet run -c Debug --project OneBee -- ../data/data_100m.txt
11.170s dotnet run -c Release --project OneBee -- ../data/data_100m.txt
11.564s dotnet publish -c Release OneBee && OneBee/bin/Release/net8.0/win-x64/publish/OneBee.exe ..data/data_100m.txt
104.404s cargo run -- ../data/data_100m.txt
9.614s cargo run -r -- ../data/data_100m.txt

All I can say is wow. The difference between debug and release Rust is massive. Rust is outperforming C# at its best, but just barely.

Round 2 - Optimize Temperature Parsing

Treat the temperatures as 16 bit signed integers and parse them by hand. Switch from rolling average to accumulating the total temperature in a 64 bit integer and averaging at the end.

Going forward, I'm only going to look at Release builds. Also skipping AoT because it didn't make a difference.

Time Command
7.327s dotnet run -c Release --project OneBee -- ../data/data_100m.txt
8.661s cargo run -r -- ../data/data_100m.txt

.NET has overtaken Rust. Neat.

Round 3 - UTF8 Numeric Parsing

Copy paste some code to avoid some of the string conversions. Still allocating a string for each lookup - not great

Time Command
6.762s dotnet run -c Release --project OneBee -- ../data/data_100m.txt

Round 4 - Stream Parser Fix

Remove my hacky fix and do a more legitimate fix. Not sure if it improved perf or if that's just margin of error.

Time Command
6.586s dotnet run -c Release --project OneBee -- ../data/data_100m.txt

1brc's People

Contributors

ensignpayton avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.