-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[DO NOT MERGE][benchmark] Modernize benchmark definitions #39331
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
base: main
Are you sure you want to change the base?
[DO NOT MERGE][benchmark] Modernize benchmark definitions #39331
Conversation
`CheckResults` → `check` `False` → `getFalse`
Cc @glessard @eeckstein @gottesmm What do you think? |
I'm particularly worried that this would disturb -Onone performance. @swift-ci benchmark |
I like it. I look forward to the first benchmark output. |
Performance (x86_64): -O
Code size: -O
Performance (x86_64): -Osize
Code size: -Osize
Performance (x86_64): -Onone
Code size: -swiftlibsHow 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 Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
Ah, too bad. |
(None of this would matter if we ran the same benchmark code across multiple compiler versions, but that's not how we do things yet.) |
Applying Swift naming conventions seems like a good idea whether or not we replace/augment In #39336, I'm updating the entire benchmark suite to read a little bit more like regular Swift code. |
@lorentey That looks great! |
This is an experiment in writing benchmark definitions in a way that's friendlier to actual Swift programmers.
struct BenchmarkInfo
with a more helpfulprotocol Benchmark
The potential benefit is that it becomes easier for contributors to develop new benchmarks -- no more weird language dialect.
The risk as I see it is either
protocol Benchmark
), orThe basic idea with
protocol Benchmark
is that instead of creating a bunch of top-level functions and static lets / vars, then registering things using:we'd define a custom struct:
and simply register instances of it as individual benchmarks:
This gets rid of the closure stuff, and encourages encapsulating the preprocessed input data in the struct itself, preventing the preprocessing from leaking into the measurement. Currently we need to remember to do this by manually triggering swift_onces in the
setUpFunction
-- this is much too tricky.