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

faster baseline import #445

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

RonnyPfannschmidt
Copy link
Member

still breaking

this change youelds a speedup form 0.69s to 0.004s for pluggy imports, by deferring imports of the stdlib

@RonnyPfannschmidt
Copy link
Member Author

@nicoddemus @bluetech i wonder if we can drop the custom parsing from pytest (for marks on hooks)
else there is need for a _types module that gets lazyly imported using getattr

@RonnyPfannschmidt
Copy link
Member Author

@RonnyPfannschmidt
Copy link
Member Author

hmm, i strongly dislike the current structure of this
the proposal for python is also going nowhere

i strongly suspect that unless apipkg provides a example something similar wont go forward

@bluetech
Copy link
Member

Deferring typing seems like too much to me...

Looking at python -Ximporttime output, importlib.metadata is a major culprit. Making it lazy (which is simpler to do) reduces the import time ~70ms -> ~30ms for me. I think we should start with this and maybe other simple imports if any and then evaluate typing separately.

@RonnyPfannschmidt RonnyPfannschmidt force-pushed the faster-import branch 3 times, most recently from 4441606 to d133dae Compare September 3, 2024 18:48
@RonnyPfannschmidt RonnyPfannschmidt changed the title WIP faster baseline import faster baseline import Sep 3, 2024
* switch ruff config to extend-select and enable UP rules
* make mypy --strict pass for src
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.

2 participants