-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[benchmark] Legacy Factor #20212
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
[benchmark] Legacy Factor #20212
Conversation
This adds optional `legacyFactor` to the `BenchmarkInfo`, which allows for linear modification of constants that unnecesarily inflate the base workload of benchmarks, while maintaining the continuity of log-term benchmark tracking. For example, if a benchmark uses `for _ in N*10_000` in its run function, we could lower this to `for _ in N*1_000` and adding a `legacyFactor: 10` to its `BenchmarkInfo`. Note that this doesn’t affect the real measurements gathered from the `--verbose` output. The `BenchmarkDoctor` has been slightly adjusted to work with these real samples, therefore `Benchmark_Driver check` will not flag these benchmarks for slow run time reported in the summary, if their real runtimes fall into the recommended range.
Lowered the base workload by a factor of 500
Lowered the base workload by a factor of 10
Lowered base workload by a factor of 10.
@eeckstein Please run benchmark here. A have a pending commit for legacy factor of |
@swift-ci benchmark |
Build comment file:Performance: -O
Code size: -O
Performance: -Osize
Code size: -Osize
How to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the regressions before you merge the PR. Noise: Sometimes the performance results (not code size!) contain false alarms. Unexpected regressions which are marked with '(?)' are probably noise. If you see regressions which you cannot explain you can try to run the benchmarks again. If regressions still show up, please consult with the performance team (@eeckstein). Hardware Overview
|
@eeckstein It looks like the demonstration of I'm a bit worried by the amount of other noise reported here. Any thoughts what's causing it? Why are there so many code size changes? Somethings smells 🐟🐠🐡 here... |
@eeckstein Let's land this as is and next I'll go through the whole Swift Benchmark Suite in batches and apply the |
The code size changes are clear: you added a field to BenchmarkInfo. That adds to the initialization code in basically every benchmark source file. |
@swift-ci smoke test |
Is there something we can do to mitigate the code alignment vs. performance issue? (I have literally no idea about this…) |
We already page-align all the benchmark modules. But that does not help if there are code changes inside the benchmark files. |
This PR adds optional
legacyFactor
to theBenchmarkInfo
, which allows for linear modification of constants that unnecessarily inflate the base workload of benchmarks, while maintaining the continuity of log-term benchmark tracking.For example, if a benchmark uses
for _ in N*10_000
in its run function, we could lower this tofor _ in N*1_000
and adding alegacyFactor: 10
to itsBenchmarkInfo
.Note that this doesn’t affect the real measurements gathered from the
--verbose
output. TheBenchmarkDoctor
has been slightly adjusted to work with these real samples, thereforeBenchmark_Driver check
will not flag these benchmarks for slow run time reported in the summary, if their real runtimes fall into the recommended range.This PR also modifies benchmarks with long runtimes to use the
legacyFactor
and lowers their base workloads, so that they run in around the 1ms mark.