4 ms·
> This Rust version doesn't allocate anything from the heap I lied—the BigUint values used as keys were still being allocated from the heap. Replacing these wi
by nybble41 5y ago
> This Rust version doesn't allocate anything from the heap
I lied—the BigUint values used as keys were still being allocated from the heap. Replacing these with Vec<u8> in the HashMap and &[u8] for the lookups brought the time down to about 31 seconds while also simplifying the code and eliminating a dependency. Bypassing the fmt library in the output code shaved off another second.