Repository navigation
feat(benchmark): add clock resolution estimation iteration limits and CLI config - #3209
Open
Tyagiquamar wants to merge 5 commits into
Open
Tyagiquamar wants to merge 5 commits into
Tyagiquamar wants to merge 5 commits into
Conversation
Author
|
Fixed the mixed-duration std::max call by converting elapsed nanoseconds to FDuration before comparison. This preserves the one-nanosecond lower bound and fractional arithmetic. Docker Ubuntu 22.04/GCC 11.4/C++14 reproduced the original compiler error; the library and SelfTest build now pass. Focused warmup, resolution, estimate_clock_resolution and Benchmark Fibonacci checks passed (19 assertions, four cases, five samples per benchmark). clang-format 14 check on the changed block and whitespace checks passed. MSVC validation is left to CI. |
The prior baseline refresh re-encoded StringManip toLower samples as UTF-8 and misplaced estimate_clock_resolution/with iteration limit. Restore the latin-1 bytes AppVeyor emits and place the section next to its parent.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #3209 +/- ##
==========================================
+ Coverage 91.17% 91.19% +0.02%
==========================================
Files 206 205 -1
Lines 9080 9104 +24
==========================================
+ Hits 8278 8302 +24
Misses 802 802 🚀 New features to boost your workflow:
|
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.
Problem Description
Resolves #3180.
When running benchmarks in constrained environments (such as embedded targets with limited RAM, e.g. 16MB),
estimate_clock_resolutioncould double iterations repeatedly inrun_for_at_leastuntil reaching excessive counts (e.g. 1,280,000+ points), causingstd::bad_allocdue to concurrent allocations oftimesanddeltasvectors. Additionally, clock resolution estimation time was hardcoded at 500ms without command-line configurability.Solution
max_iterationsbound support torun_for_at_least.clock_resolution_estimation_max_iterationscap inestimate_clock_resolutionand bounded sample count allocation inestimate_clock_cost.--benchmark-estimate-clock-timeon the command-line interface,ConfigData,Config, andIConfig(default: 500ms) matching--benchmark-warmup-time.InternalBenchmark.tests.cpp.CmdLine.tests.cpp.Tests
InternalBenchmark.tests.cppCmdLine.tests.cpp