-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Improve Benchmark Accuracy #2336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
tests/BenchmarkDotNet.IntegrationTests.ManualRunning/ExpectedBenchmarkResultsTests.cs
Outdated
Show resolved
Hide resolved
48266cd to
4abbb1f
Compare
213549a to
7080e63
Compare
3e4f122 to
e3e774b
Compare
|
Unfortunately, I no longer have an Intel CPU to test this, but I think the new results from this PR should address the issues you had in #2334 @AndreyAkinshin (results look good on my AMD 9800X3D CPU in .Net 8). |
e3e774b to
f1a89ed
Compare
Don't fail silently. Remove unused property. Embed the weaver into BenchmarkDotNet.Annotations package instead of another package dependency.
|
@dotnet/jit-contrib any thoughts on this? |
Fixed formatting.
# Conflicts: # build/common.props
Write to MemoryStream first for efficiency.
# Conflicts: # BenchmarkDotNet.sln # NuGet.Config # build/common.props # src/BenchmarkDotNet.Annotations/BenchmarkDotNet.Annotations.csproj # src/BenchmarkDotNet/Code/CodeGenerator.cs # src/BenchmarkDotNet/Templates/BenchmarkType.txt # src/BenchmarkDotNet/Toolchains/InProcess/Emit/Implementation/Emitters/RunnableEmitter.cs # tests/BenchmarkDotNet.Tests/Running/RunningEmptyBenchmarkTests.cs
06602c7 to
39817d3
Compare
|
Interestingly, on Apple M3, an empty method is measured at 0.9ns while a method that increments a field is measured at 0.66ns, which results in the overhead measurement looking "wrong". I don't know if this is specific to M chips or Arm in general, but it doesn't happen on xArch. There does not seem to be a good way for BDN to account for this μarch quirk. |
Fixes #1133
Fixes #2305
Fixes #1802
Fixes #2530
voidfor a fair baseline for all benchmark return types.Consumeror aNoInliningmethod.MethodImplOptions.NoInliningto benchmark methods.