chmduquesne / rollinghash

Implementation of some rolling hashes in go
MIT License
63 stars 11 forks source link

Use `Len64` from "math/bits" in `Deg` #18

Open albert-bedrock opened 11 months ago

albert-bedrock commented 11 months ago

Switches the Deg function in rabinkarp64/polynomials.go to use Len64 instead of the bit hacks version.

On my machine, this does not produce much of a speedup for go run roll/main.go but does speed up the rabin karp tests from ~23s to ~6s .

Benches

A small difference, but I did an unpaired t-test and it seems to be real.

Command:

hyperfine 'go run roll/main.go -size 2G'

Notes