Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

albert-bedrock
Copy link

@albert-bedrock albert-bedrock commented Oct 4, 2023

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'
  • On main branch
    Time (mean ± σ):      9.293 s ±  0.069 s    [User: 6.782 s, System: 2.563 s]
    Range (min … max):    9.200 s …  9.411 s    10 runs
    
  • With changes to Deg
    Time (mean ± σ):      9.114 s ±  0.079 s    [User: 6.632 s, System: 2.529 s]
    Range (min … max):    8.981 s …  9.236 s    10 runs
    

Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant