Open RonnyPfannschmidt opened 11 months ago
@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
i also started https://discuss.python.org/t/deferred-computation-evalution-for-toplevels-imports-and-dataclasses/34173 as a result of this
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
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.
still breaking
this change youelds a speedup form 0.69s to 0.004s for pluggy imports, by deferring imports of the stdlib