fix: instantiate perf observer for each iteration #3585
Merged
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.
Changes to instantiate a
PerformanceObserver
instance for eachiteration of a benchmark run. This prevents the observer from being
killed before all iterations of the wrapped function run due to
environment changes that may cause the observer from falling out of
scope and being GCed. Previously in github actions only a single run's
results were recorded as the observer was killed after the first
iteration, though this wasn't the case when running locally.
Additionally adds the option to record profiles for benchmarks and write
them to a directory. This can be used to compare call stacks of
benchmarks across changes to the code.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.