-
Notifications
You must be signed in to change notification settings - Fork 10.5k
BenchmarkDriver Strangler replaces Benchmark_Driver run #18924
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
BenchmarkDriver Strangler replaces Benchmark_Driver run #18924
Conversation
Improving complience with PEP 257 -- Docstring Conventions https://www.python.org/dev/peps/pep-0257/
The test number column in the space justified column format emmited by the Benchmark_Driver to stdout while logging to file is right aligned, so it must handle leading whitespace.
Moved the `log_file` path construction to the `BenchmarkDriver`. Retired `get_*_git_*` functions.
Added tests for `log_results` and the *space-justified-columns* format emited to stdout while logging to file.
Moved `log_results` to BenchmarkDriver.
Clean up after removing bogus agregate statistics from last line of the log. It makes more sense to report the total number of executed benchmarks as a sentence that trying to fit into the format of preceding table. Added test assertion that `run_benchmarks` return csv formatted log, as it is used to write the log into file in `log_results`.
Moved all `run` command related functionality to `BenchmarkDriver`.
@eeckstein Please review 🙏 |
@swift-ci please benchmark |
@swift-ci please smoke test |
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.
lgtm, thanks!
Just a few minor comments.
@@ -308,7 +308,7 @@ def _reset(self): | |||
|
|||
# Parse lines like this | |||
# #,TEST,SAMPLES,MIN(μs),MAX(μs),MEAN(μs),SD(μs),MEDIAN(μs) | |||
results_re = re.compile(r'(\d+[, \t]*\w+[, \t]*' + | |||
results_re = re.compile(r'([ ]*\d+[, \t]*\w+[, \t]*' + |
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.
nitpick: brackets are not required around the single space
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 did not know that space and a star would work. This way it is in same style as all the other repeated groups. Do you want me to change it?
@@ -55,6 +55,9 @@ class BenchmarkDriver(object): | |||
self.tests = tests or self._get_tests() | |||
self.parser = parser or LogParser() | |||
self.results = {} | |||
# Set a constant hash seed. Some tests are currently sensitive to | |||
# fluctuations in the number of hash collisions. | |||
os.environ['SWIFT_DETERMINISTIC_HASHING'] = '1' |
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.
That's an important change. It should be in a separate commit or at least be mentioned in the commit message
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’m not sure what you mean. Deterministic hashing env variable was added some 5 months ago by @lorentey. I’ve just added a unit test for it and moved the implementation into BenchmarkDriver
class.
Build comment file:Optimized (O)Regression (1)
Improvement (1)
No Changes (445)
Unoptimized (Onone)Regression (5)
Improvement (6)
No Changes (436)
Hardware Overview
|
@eeckstein Benchmarks finished successfully. Can you merge this as is or should I change something? |
This is a followup to PR #18719 that concludes the StranglerApplication of the
Benchmark_Driver
'srun
command. The remaining free-standing functions implementing therun
command were replaced with methods onBenchmarkDriver
class with full unit test coverage.The functionality remains unchanged with the exception of cleaning up the last "Totals" line of the log reports, after removing the bogus aggregate statistics. It now simply states the number of executed benchmarks:
I've structured the PR as a series of small, incremental changes with detailed descriptions in the commit messages, it is therefore best reviewed sequentially by individual commits.