-
Notifications
You must be signed in to change notification settings - Fork 125
Add benchmarks for DABs #4194
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
Add benchmarks for DABs #4194
Conversation
|
Current output: Same but with GOGC=off: |
|
Commit: f4995ea
22 interesting tests: 21 KNOWN, 1 SKIP
Top 21 slowest tests (at least 2 minutes):
|
shreyas-goenka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just some minor comments.
|
|
||
| Benchmarks are regular acceptance test that log measurements in certain format. The output can be fed to `tools/bench_parse.py` to print a summary table. | ||
|
|
||
| Test runner recognizes benchmark as having "benchmark" anywhere in the path. For these tests parallel execution is disabled if and only if BENCHMARK\_PARAMS variable is set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a separate top level benchmarks directory? That's better for discoverability since we can eyeball all benchmarks that exists. That also maintains a clear separation between tests and benchmarks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be harder to separate different projects inside CLI if we add another entry point. Today we have roughly this structure
- cmd/project
- acceptance/project
and we have tools that depend on it (testmask). Adding top level benchmarks directory requires making those tools aware.
cc @pietern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note, this is something we can revisit later.
| @@ -0,0 +1,2 @@ | |||
|
|
|||
| >>> benchmark.py $CLI bundle plan > /dev/null | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also log / commit the benchmarks numbers? For local vs cloud? Useful numbers to eyeball and keep track of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I logged them as a comment above. Absolute numbers are not useful due to different machines. I expect when someone improves the benchmarks they will post before/after numbers.
| test_match = re.match(r"=== RUN\s+(.+)", line) | ||
| if test_match: | ||
| current_test = test_match.group(1) | ||
| current_test = current_test.removeprefix("TestAccept/bundle/benchmarks/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this hardcoded here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
readability
|
Commit: 9747a93
26 interesting tests: 21 KNOWN, 2 flaky, 2 FAIL, 1 SKIP
Top 50 slowest tests (at least 2 minutes):
|
Changes
Benchmarks are regular acceptance test that log measurements in certain format. The output can be fed to "tools/bench_parse.py" to print a summary table.
Test runner recognizes benchmark as having “benchmark” anywhere in the path. For these tests parallel execution is disabled if and only if BENCHMARK_PARAMS variable is set.
The benchmarks make use of two scripts:
gen_config.py —jobs Nto generate a config with N jobsbenchmark.py commandto run command a few times and log the time measurements.The default number of runs in benchmark.py depends on BENCHMARK_PARAMS variable. If it’s set, the default number is 5. Otherwise it is 1.
Note, bundle/benchmarks/deploy benchmarks the case when there are no changes to be deployed. If we actually measure first deployment, the time goes up from 40s to 140s for terraform but time for direct is more or less the same.
Why
Understand choke points, set the baseline for further optimizations.
Tests
Each benchmark by default is run as regular acceptance test (with a single run).