Coder Social home page Coder Social logo

1brc_rust's Introduction

brc

Simple solution for 1 billion rows challenge.

I assumed to have a limitation to use only standard library and no crates.

The solution has multithread mode (default, 8 threads) and single thread modes (activated by -s flag). Also printing result could be disabled by -q flag. Because I'm not using any crates cli flags processing is very basic.

On my mac single thread solution takes 80 seconds, multithread solution takes 12 seconds (input file is 14 GB).

What could be improved

  • Map file with data into memory (memmap2 crate is required)
  • Faster hashmap (hashbrown crate is required)

Getting data

File measurements.txt is required to be in the repo to measure performance. It could be generated by steps from 1brc's instruction. I used docker, because I don't have java on my mac:

git clone https://github.com/gunnarmorling/1brc/
cd 1brc
docker run -it --mount source=$(pwd),target=/home eclipse-temurin:21 /bin/bash
# inside docker:
cd home
./mvnw clean verify
./create_measurements.sh 1000000000
exit
# on host
mv ./measurements.txt <1brc_rust path>

Thanks

1brc_rust's People

Contributors

kuznetsss 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.