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

Performance issue with internal trie structure? #109

Open
adbar opened this issue Oct 5, 2021 · 0 comments
Open

Performance issue with internal trie structure? #109

adbar opened this issue Oct 5, 2021 · 0 comments

Comments

@adbar
Copy link

adbar commented Oct 5, 2021

Hi, thanks for the package, which I'm using a lot in different projects. I was profiling my code with pprofile and noticed a potential performance issue in the function get_tld_names().

It's a recursive fonction but it does not seem to be the problem here, the trie data structure in trie.py appears to be slow, because adding elements to the trie is slow or maybe because the fonction is called (too) often?

Here are the lines that caught my attention:

def get_tld_names(cls, fail_silently: bool = False, retry_count: int = 0):

for line in local_file:

trie_add(f"{line.strip()}", private=private_section)

Could you please have a look at this?

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

No branches or pull requests

2 participants