Reduce randomness of invoke benchmarks #2602
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.
Helps reduce randomness\error of the invoke benchmarks by changing the iteration from 1 to 1,000 for each benchmark by adding a simple
forloop. Once these changes are in, we will document and ignore newly generated perf regressions issues.Also added was a benchmark for getting\setting a field that contains a reference type.
These were noted in dotnet/runtime#74938. The benchmarks details below were before and after the change to dotnet/runtime#74614 which now show:
Basically, those changes avoid two method calls (caller to invoker, and from the invoker back to the callee). These actual perf results are heavily dependent on the JIT as to whether these calls add overhead or not...
Note that only these 4 field get\set benchmarks are affected by the before\after results below, so these are also useful to compare randomness\error:
Benchmarks with 1 iteration of each test (two full runs) (+- ~6% accuracy)
Benchmarks with 1,000 iterations of each test (two full runs) (+- ~2% accuracy)