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

[CI] tests related to guessers are slow #4842

Open
orbeckst opened this issue Dec 18, 2024 · 3 comments · May be fixed by #4893
Open

[CI] tests related to guessers are slow #4842

orbeckst opened this issue Dec 18, 2024 · 3 comments · May be fixed by #4893

Comments

@orbeckst
Copy link
Member

Expected behavior

Tests run reasonably quickly in our CI (let's say, faster than ~20 seconds).

Actual behavior

The top 3 slowest tests are all related to guessing functionality and take between 25 and 100 seconds. E.g. from https://github.com/MDAnalysis/mdanalysis/actions/runs/12399640935/job/34615007364?pr=4729 :

100.18s call     MDAnalysisTests/guesser/test_base.py::TestBaseGuesser::test_guessing_angles_respects_bond_kwargs
25.62s call     MDAnalysisTests/guesser/test_base.py::TestBaseGuesser::test_guess_topology_objects_out_of_order_init
25.50s call     MDAnalysisTests/guesser/test_base.py::TestBaseGuesser::test_guess_topology_objects_out_of_order_guess
@tanishy7777
Copy link
Contributor

So should the tests for these three functions be rewritten to speed it up? @orbeckst

@orbeckst
Copy link
Member Author

You are asking a very good question, @tanishy7777 .

I haven't looked at tests or the code, I only noticed that they seem to take a very long time compared to other tests. Given that the new guesser code is a recent addition (in 2.8.0), we should look at the impact that this code has. The first step would be understanding why they take so long: are the tests written in a complicated way and could be shortened or is the underlying guesser code slow?

@tanishy7777
Copy link
Contributor

tanishy7777 commented Dec 24, 2024

I ran cProfiler(thrice to make sure of the results) on these test functions on my local system
The test_guess_topology_objects_out_of_order_init and test_guess_topology_objects_out_of_order_guess take about 5 seconds each and test_guessing_angles_respects_bond_kwargs takes about 25 seconds.
I have attached the output below. I am not sure what is causing it to take so long on github CI.
@orbeckst

image
image
image

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

Successfully merging a pull request may close this issue.

2 participants