Add --filter-failed to exclude failed results from speed comparison#861
Open
tavian-dev wants to merge 3 commits intosharkdp:masterfrom
Open
Add --filter-failed to exclude failed results from speed comparison#861tavian-dev wants to merge 3 commits intosharkdp:masterfrom
tavian-dev wants to merge 3 commits intosharkdp:masterfrom
Conversation
When using --ignore-failure with parameter scans, some parameter combinations may fail (non-zero exit code) and produce misleadingly fast times that skew the relative speed comparison. This adds a --filter-failed flag that excludes results with non-zero exit codes from the relative speed comparison in the summary output. Closes sharkdp#591
When --filter-failed is used with --reference, the reference command might itself have failures and get filtered. Previously this would use the wrong command as reference. Now falls back to fastest_of the remaining results.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
When using
--ignore-failurewith parameter scans, some parameter combinations may fail (non-zero exit code) and produce misleadingly fast times that skew the relative speed comparison. A command that errors out in 10ms shouldn't appear as "fastest" when comparing against commands that ran successfully for 2s.This adds a
--filter-failedflag that excludes benchmark results with any non-zero exit code from the relative speed comparison in the terminal summary output.Usage
hyperfine --ignore-failure --filter-failed \ --parameter-list size 100,1000,10000 \ 'my-tool --size {size}'What it does
BenchmarkResult::has_failure()method that checks for non-zero or missing exit codes--filter-failedis set, filters results before computing relative speeds in the summaryWhat it doesn't do
--ignore-failurebehavior — the two flags are independentTests
has_failure()edge cases, 1 for the filtering behavior in relative speed comparisonCloses #591