Skip to content

Use a refactored, faster implementation of the Sardinas-Patterson algorithm #50

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

Merged
merged 3 commits into from
Nov 20, 2023

Conversation

sts10
Copy link
Owner

@sts10 sts10 commented Nov 20, 2023

As part of another project, @westonal refactored my implementation of Sardinas-Patterson. I then adapted it to also apply these speed-ups to Schlinkert pruning in Tidy.

The speed-up is by about 80%. Awesome!

…ely decodable check and in Schlinkert pruning. Should be about 80% faster
@sts10
Copy link
Owner Author

sts10 commented Nov 20, 2023

An informal benchmark:

time tidy -AAAA --schlinkert-prune --dry-run 1password-wordlist-as-of-2021.txt 

An 18,176-word, non-uniquely decodable list.

Old version of Tidy (v0.3.4)

New list length is 15,841

real	3m49.087s
user	3m48.849s
sys	0m0.084s

With refactored UD check and Schlinkert pruning (this PR)

New list length is 15,841

real	1m27.386s
user	1m27.230s
sys	0m0.037s

@sts10 sts10 changed the title Use an improved, faster implementation of sardinas-patterson algorithm Use a refactored, faster implementation of the Sardinas-Patterson algorithm Nov 20, 2023
@sts10
Copy link
Owner Author

sts10 commented Nov 20, 2023

I think this is good to merge as is. I'm just going to sleep on it and see if I think of any other tests I want to try before merging tomorrow.

@sts10 sts10 merged commit 813c394 into main Nov 20, 2023
@sts10 sts10 deleted the refactor_sd_and_schlinkert branch November 20, 2023 16:55
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