[benchmark test] use average when asserting against perf threshold #69
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.
What it does
The recently added assertions in the benchmark test, that confirm that the new async handler is much more performant vs the old sync handler, were failing the test once in a while.
Originally the assertions were against each test run - those runs with fewer iterations were very sensitive to interference by e.g. GC.
e.g. imagine that a 10-20 ms GC occurs while doing one of the runs below, while performing logging using
"AsyncNew"- it could easily make"AsyncNew"look much less performant vs"SyncOld", once in a while making theAsyncNewVsSyncOldratio look too low and failing the test:Here's a case where it happened locally during the "10580" run for AsyncNew, just about doubling its apparent duration:

After this commit, the performance is asserted against the average performance of
AsyncNewvsSyncOld, over the totals of all runs (separately for the Regular vs Lean benchmarks). The total/average info is now printed onstdoutin human-readable form, under the existing table:How to test
Verify that CI passes.
Follow-ups
N/A
Review checklist