This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Corlin Palmer's Go solution to the 1BRC coding challenge: https://github.com/gunnarmorling/1brc | |
- This solution reads the file sequentially as fast as possible (reader) | |
- It passes off the job of ensuring that each chunk ends with a complete line to another goroutine (lineSupervisor) | |
- The lineSupervisor sends valid chunks to a pool of worker goroutines (worker) which parse the data and calculate the results | |
- The results from the workers are collected in a map and then sorted before printing the final results | |
A fair amount of optimization has been done to reduce memory allocations. |