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

Regression in import time #188

Open
Dreamsorcerer opened this issue Sep 12, 2024 · 2 comments
Open

Regression in import time #188

Dreamsorcerer opened this issue Sep 12, 2024 · 2 comments

Comments

@Dreamsorcerer
Copy link

In aiohttp we have a regression test for the import time of the library.
When using idna <=3.6, the test is passing, but with idna 3.7+ the test fails consistently, indicating a significant regression in import time.

Looking at the changes, the only obvious change is the massive amount of data added to idnadata.py (in joining_types). Maybe this could be lazy loaded, e.g. by putting the construction in a function with a @cache decorator, or by coming up with a more efficient data structure?

@kjd
Copy link
Owner

kjd commented Sep 15, 2024

Will look into improving the performance here, patches are welcome!

I haven't looked into it, but some of the odd data structures we use are informed by Jython and a 64kb limit it has on such structures, which I suspect he recent changes to joining_types also transgresses. Need to find a way to test if that is also affected as part of looking into this.

@Dreamsorcerer
Copy link
Author

Dreamsorcerer commented Sep 15, 2024

I have no idea what joining_types actually does, so don't have any obvious suggestions on how to improve the data structure. If you want to go with the lazy load function, I can take a look at that later. Should be pretty trivial.

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

2 participants