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

It gets very slow for some password lengths #7

Closed
duzun opened this issue Sep 18, 2014 · 8 comments
Closed

It gets very slow for some password lengths #7

duzun opened this issue Sep 18, 2014 · 8 comments

Comments

@duzun
Copy link
Contributor

duzun commented Sep 18, 2014

For password testScorePassword123 it takes 0.5 sec to compute the score, which is A LOT!

It looks like there is some high complexity algorithm, cause time grows exponentially after some length.

@jessemx109
Copy link
Contributor

This happens because DBMatcher's are being allocated multiple times which is loading the frequency lists using lots of memory. If you put the frequency list initialization in a singleton it stops the memory leak and makes performance good again

@duzun
Copy link
Contributor Author

duzun commented Sep 18, 2014

This is not the case. DBMatcher is alocated exactly once in [DBZxcvbn init];
Acording to my tests, most of the time is spent inside this call:
DBResult *result = [self.scorer minimumEntropyMatchSequence:password matches:matches];

@jessemx109
Copy link
Contributor

In the spacialEntropy call in DBScorer the allocate method is called again. I believe this method is only called on long passwords and thats why the slowdown only happens on longer passwords

@duzun
Copy link
Contributor Author

duzun commented Sep 18, 2014

IF DBMatcher is so slow, I think it should share the data between instances, with the posibillity to free it when needed.

@jessemx109
Copy link
Contributor

Thats what I did to fix it I wrapped the initialization of the frequency lists and adjacency graphs in a singleton object so they are only ever created once and it sped up the performance significantly

@leah
Copy link
Collaborator

leah commented Sep 22, 2014

@jessemx109 want to submit a pull request with that change? That would be really nice 😄

@erikackermann
Copy link
Contributor

👍 would appreciate that performance boost

@leah
Copy link
Collaborator

leah commented Oct 7, 2014

I think this was done in #8?

Closing this issue but feel free to re-open if there's more we can do to improve this.

@leah leah closed this as completed Oct 7, 2014
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

No branches or pull requests

4 participants