Categorygithub.com/alvarojoselopes/1brc
repository
0.0.0-20250102175056-373a1d019ddb
Repository: https://github.com/alvarojoselopes/1brc.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# README

1BRC challenge

Solution for 1BRC (The One Billion Row Challenge)

Solutions

Baseline

Simple solution that reads the lines sequentially and aggregate the result line by line (count, min, max and sum).

Iterators

This solution uses iterators to yield chunks of data from the file and aggregates the final result chunk by chunk.

Channels

Solution that uses channels to implement MapReduce pattern.

One worker is responsible for reading the file in chunks and sending each chunk to the jobs channel.

N consumers retrieve chunks from the jobs channel and calculate the statistics (count, min, max and sum of the chunk), sending it to the result channel.

The main goroutine consumes the result and reduces each chunk result and reports the final statistics.