This is my nice and safe rust implementation of the java 1brc
After all of my changes I think that the biggest way to speed this up is using a custom made hashmap, a linear probe with a very simple hash like FNV, pluse computing the hash as we iterate over the text instead of calling the hashmap entry
function.
- 3.6 GHz with 16 cores
- 16 GB of ram
- slow AF hard drive ( but the test was done with a hot page without it we need like 5 min to read the file of the disk )
real 2m35.141s user 0m0.000s sys 0m0.015s
real 1m7.125s user 0m0.000s sys 0m0.000s
real 0m40.704s user 0m0.000s sys 0m0.000s
real 0m36.119s user 0m0.000s sys 0m0.000s
real 0m35.752s user 0m0.000s sys 0m0.000s
real 0m34.433s user 0m0.000s sys 0m0.000s
real 0m33.155s user 0m0.000s sys 0m0.000s
real 0m4.718s user 0m0.000s sys 0m0.000s
real 0m4.531s user 0m0.000s sys 0m0.000s