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

speed up tests by caching checked paths in set_tmpdir + less test cases for test_compiler_dependent_optarch #3802

Merged
merged 3 commits into from
Aug 19, 2021

Conversation

Flamefire
Copy link
Contributor

@Flamefire Flamefire commented Aug 12, 2021

Noticed that one test was particularly slow in #3797 so I dug a bit and came up with these issues:

  • Don't recheck temp folder for executability
  • Reduce number of combinations tested in 1 test from 216 to 20

See the commits for details

`run_cmd` is one of the slowest things we can do as it forks the whole process.
In the check when setting a temp dir we run a dummy file to see if the
folder is actually executable. This means running this check at least
twice per test case and another time for each init_config call in the
test amounting to e.g. 263 calls in a single test (test_compiler_dependent_optarch)

So cache the results and don't repeat the run_cmd if it already
succeeded for a parent folder.
Likely no change at all in regular mode but really helps for the tests
The full product of options is not required to cover all cases.
Instead run only with varying options per active toolchain and a single
case (actually 2) for PGI
This cuts down the combinations from 216 to 20 and runtime from ~1m to ~7s
Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@boegel boegel changed the title Performance improvements of tests speed up tests by caching checked paths in set_tmpdir + less test cases for test_compiler_dependent_optarch Aug 19, 2021
@boegel boegel merged commit 4ac730d into easybuilders:develop Aug 19, 2021
@Debulknor
Copy link

@Flamefire Flamefire deleted the perf-improvements branch August 30, 2021 08:59
@boegel boegel added enhancement and removed bug fix labels Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants