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

Change to more efficient worker termination #1358

Merged
merged 1 commit into from
Nov 21, 2022
Merged

Conversation

mbj
Copy link
Owner

@mbj mbj commented Nov 21, 2022

  • Before: Mutant would terminate all worker processes in sequence, while waiting for each pid to terminate separtae. This creates way more context switches than needed and resulted in a serial bottleneck.
  • Now mutant signals all worker processes than collects the statuses in a secondary loop.
  • Reducing this serial dependency improves mutant exit performance by several seconds on a high core cound machine, and is also measurable on more regular machines.
main: time bundle exec mutant run --zombie --since HEAD # 0 mutations selected.

5.69s user 4.35s system 99% cpu 10.061 total

this-branch: bundle exec mutant run --zombie --since HEAD # 0 mutations seleced.

6.23s user 50.38s system 1189% cpu 4.760 total 

Note for this benchmarks mutant needs to dynamically self vendor first, --zombie is quite expensive and noone but mutant developers should ever use it.

* Before: Mutant would terminate all worker processes in sequence, while
  waiting for each pid to terminate separtae.
  This creates way more context switches than needed and resulted in a
  serial bottleneck.
* Now mutant signals all worker processes than collects the statuses in
  a secondary loop.
* Reducing this serial dependency improves mutant exit performance by
  several seconds on a high core cound machine, and is also measurable
  on more regular machines.
@mbj mbj self-assigned this Nov 21, 2022
@mbj mbj merged commit 5b57790 into main Nov 21, 2022
@mbj mbj deleted the change/to-faster-signal branch November 21, 2022 02:46
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.

1 participant