Speed up testpythoneval#2635
Merged
gvanrossum merged 6 commits intopython:masterfrom Jan 5, 2017
ambv:testpythoneval_speed
Merged
Speed up testpythoneval#2635gvanrossum merged 6 commits intopython:masterfrom ambv:testpythoneval_speed
gvanrossum merged 6 commits intopython:masterfrom
ambv:testpythoneval_speed
Conversation
added 2 commits
January 4, 2017 01:42
Splits eval-test into simple buckets by first letter of test name, enabling parallel execution. This speeds up execution of the test suite by around 25% on my laptop. The split enables more consistent loading of all CPU cores during the entire run of ./runtests.py. To achieve this, I had to modify testpythoneval.py to not write all testcase inputs to the same temporary path. Before: SUMMARY all 204 tasks and 1811 tests passed *** OK *** total time in run: 554.571954 total time in check: 214.105742 total time in lint: 130.914682 total time in pytest: 92.031659 ./runtests.py -j4 -v 744.76s user 74.10s system 235% cpu 5:48.34 total After: SUMMARY all 225 tasks and 3823 tests passed *** OK *** total time in run: 640.698327 total time in check: 178.758370 total time in lint: 149.604402 total time in pytest: 78.356671 ./runtests.py -j4 -v 850.81s user 81.09s system 353% cpu 4:23.69 total Total wall clock time fell from 5:48 to 4:23. Note: the test sum is now over-reported. Looks like the driver counts also the filtered out tests in eval-test. I don't have cycles now to hunt this down.
Contributor
Author
|
While I wouldn't bet on Travis for benchmarking, master was consistently taking around 20 minutes to pass all tests. With this change, this is down to 11 minutes. ✨ |
Contributor
Author
|
OK, this is now much more friendly for review. Under 100 significant lines in total, just two files. |
Member
|
Looks good! Thanks for doing this. (But really, I wish we could kill runtests.py in favor of migrating everything to pytest...) |
Contributor
Author
Agreed! I see there's discussion on #1673, let me comment there on steps forward. For this pull request here, parallelizing testpythoneval.py was the lowest hanging fruit in terms of runtime savings which cuts down our waits today :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Splits eval-test into simple buckets by first letter of test name, enabling
parallel execution. This speeds up execution of the test suite by around 25% on
my laptop. The split enables more consistent loading of all CPU cores during
the entire run of ./runtests.py.
To achieve this, I had to modify testpythoneval.py to not write all testcase
inputs to the same temporary path.
Before:
After:
Total wall clock time fell from 5:48 to 4:23.
Note: the test sum is now over-reported. Looks like the driver counts also the
filtered out tests in eval-test. I don't have cycles now to hunt this down.