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

pytest collecting phase is slow #1686

Open
albertz opened this issue Feb 6, 2025 · 0 comments
Open

pytest collecting phase is slow #1686

albertz opened this issue Feb 6, 2025 · 0 comments

Comments

@albertz
Copy link
Member

albertz commented Feb 6, 2025

Running some simple selected test takes a long time. Most of that time is spent in the collecting phase.

That's very annoying for debugging. Also, I don't quite understand why it is so slow. But you find quite a number of related reports, e.g. this, this, this. They mostly suggest to restrict the paths which are searched for the tests. We already do that, and that doesn't really seem to have much impact. Although, when running a single specific test, I also don't really understand why it needs to search through all the other tests.

E.g. when running python -mpytest test_rf_array.py::test_gather_3d_embed with strace -e trace=file:

11:35:06 execve(...)
...
11:36:08
collected 1 item
...
11:36:09 +++ exited with 0 +++

Of course, this imports torch, tensorflow, numpy, and some other libs, and this already takes some time, but this should be only 10 secs or so.

We should better understand what takes so long, e.g. by profiling/tracing this. And then maybe we can fix this.

(cc @NeoLegends)

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

1 participant