Repository navigation
perf(engine): prepare each worker once and read summaries from a spool - #249
Merged
Merged
Conversation
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.
Profile
mitmproxy,
-j 8, main: 501 components, each one a task.364 MB of summaries were shipped in total.
Change
initializer(_Project,_start_worker).--cachedirectory, or a temporary directory of the run, removed at the end. Each worker reads an entry at most once.encode_indexanddecode_index, now unused, are removed.-j 1path is unchanged.Measurements
macOS, 8 cores (4 performance, 4 efficiency), Python 3.14, bundled plugins, cold start, low load. Reports are identical in every mode.
-j 1-j 8on main-j 8with this change-j 8Runs under heavy external load point the same way (user time,
-j 8: 286 s → 124 s).What remains
mitmproxy gains little over
-j 1. One 37-module import cycle is analysed by a single process, and each wave waits for its slowest component.docs/usage.mdnow says so, in place of the "saves a quarter" sentence, with the measured table.Verification
tests/test_jobs_workers.py, new. One test checks that a worker instantiates the plugins once (it fails on main: 8 instantiations for 2 workers). Two tests check that summaries reach the modules of later waves, with and without--cache, with the same report as-j 1. No existing test changed.test_packagingmetadata issue (fails on main too).ruff checkandmypyclean.