/1brc

Golang Solution for 1Billion Row Challenge.

Primary LanguageGo

1brc

Golang solution for the 1brc challenge.

Approach

  • Split the file into chunks for parallel reading.
  • Parse the chunks simultaneously.
  • Monitor the chunks and compute the average.
  • Arrange the data in alphabetical order based on the name.
  • Display the calculated average.

Usage

  • build the binary
go build
  • run the binary
1brc <path to the measurement file>

Performance

Average Time taken: 14.8s

NOTE: The time taken is with a MacBook M2 Pro.

CPU flame graph: cpu-flame-graph