Skip to content

Speed up testpythoneval #2635

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

Merged
merged 6 commits into from
Jan 5, 2017
Merged

Speed up testpythoneval #2635

merged 6 commits into from
Jan 5, 2017

Conversation

ambv
Copy link
Contributor

@ambv ambv commented Jan 4, 2017

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.

Lukasz Langa 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.
@ambv
Copy link
Contributor Author

ambv commented Jan 4, 2017

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. ✨

@ambv
Copy link
Contributor Author

ambv commented Jan 4, 2017

OK, this is now much more friendly for review. Under 100 significant lines in total, just two files.

@gvanrossum gvanrossum merged commit 996e3e8 into python:master Jan 5, 2017
@gvanrossum
Copy link
Member

Looks good! Thanks for doing this. (But really, I wish we could kill runtests.py in favor of migrating everything to pytest...)

@ambv
Copy link
Contributor Author

ambv commented Jan 5, 2017

(But really, I wish we could kill runtests.py in favor of migrating everything to pytest...)

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 :)

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

Successfully merging this pull request may close these issues.

2 participants