Add some functionality to misc/perf_compare.py #18471
Open
+73
−20
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.
While working on determining the performance impact of #17875, I discovered misc/perf_compare.py. I extended its functionality slightly, introducing an -r flag to check a foreign repo instead of mypy itself. I also added a --dont-setup flag, to save time on recompiling mypy. I added several helpful printouts: the standard deviations of the samples, an epilog reminding you to probably specific master, a line at the bottom listing the total time taken by the whole benchmarking program.
As a caveat, I should flag: when running the benchmark on the foreign repo, it typically spits out a lot of errors, presumably because the libraries aren't installed. That actually also happens to me when running the mypy self-check, though, for whatever reason, so I didn't worry about it.
Another caveat I'll flag on the off-chance it's important: on my machine, this script seems constitutionally incapable of deleting the tmp dirs it makes. It fails with a permissions error. But it was like that when I got it.