-
Notifications
You must be signed in to change notification settings - Fork 151
Reduce allocations in TraceContext
#7851
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
base: master
Are you sure you want to change the base?
Conversation
BenchmarksBenchmarks Report for benchmark platform 🐌Benchmarks for #7851 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ More allocations
|
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 | 6.01 KB | 6.06 KB | 51 B | 0.85% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartStopWithChild |
net6.0 | 9.99μs | 54.5ns | 332ns | 0 | 0 | 0 | 5.5 KB |
| master | StartStopWithChild |
netcoreapp3.1 | 13.6μs | 70.4ns | 330ns | 0 | 0 | 0 | 5.71 KB |
| master | StartStopWithChild |
net472 | 21.8μs | 120ns | 741ns | 0.978 | 0.435 | 0.109 | 6.01 KB |
| #7851 | StartStopWithChild |
net6.0 | 9.91μs | 9.4ns | 36.4ns | 0 | 0 | 0 | 5.51 KB |
| #7851 | StartStopWithChild |
netcoreapp3.1 | 13.8μs | 66.1ns | 273ns | 0 | 0 | 0 | 5.72 KB |
| #7851 | StartStopWithChild |
net472 | 22.3μs | 99.5ns | 385ns | 0.994 | 0.331 | 0.11 | 6.06 KB |
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7851
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472
3.31 KB
3.33 KB
23 B
0.70%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 | 3.31 KB | 3.33 KB | 23 B | 0.70% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 939μs | 45.8ns | 177ns | 0 | 0 | 0 | 2.7 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.02ms | 623ns | 2.41μs | 0 | 0 | 0 | 2.7 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 1.22ms | 61.8ns | 231ns | 0 | 0 | 0 | 3.31 KB |
| #7851 | WriteAndFlushEnrichedTraces |
net6.0 | 945μs | 529ns | 2.05μs | 0 | 0 | 0 | 2.7 KB |
| #7851 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.03ms | 66.4ns | 239ns | 0 | 0 | 0 | 2.7 KB |
| #7851 | WriteAndFlushEnrichedTraces |
net472 | 1.24ms | 1.76μs | 6.82μs | 0 | 0 | 0 | 3.33 KB |
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | AllCycleSimpleBody |
net6.0 | 1.09μs | 1.29ns | 5.01ns | 0 | 0 | 0 | 1.22 KB |
| master | AllCycleSimpleBody |
netcoreapp3.1 | 1.39μs | 7.67ns | 46.6ns | 0 | 0 | 0 | 1.2 KB |
| master | AllCycleSimpleBody |
net472 | 1.03μs | 0.897ns | 3.47ns | 0.194 | 0 | 0 | 1.23 KB |
| master | AllCycleMoreComplexBody |
net6.0 | 7.28μs | 33.8ns | 131ns | 0 | 0 | 0 | 4.72 KB |
| master | AllCycleMoreComplexBody |
netcoreapp3.1 | 8.98μs | 32ns | 124ns | 0 | 0 | 0 | 4.62 KB |
| master | AllCycleMoreComplexBody |
net472 | 7.7μs | 4.79ns | 18.6ns | 0.729 | 0 | 0 | 4.74 KB |
| master | ObjectExtractorSimpleBody |
net6.0 | 331ns | 1.68ns | 7.52ns | 0 | 0 | 0 | 280 B |
| master | ObjectExtractorSimpleBody |
netcoreapp3.1 | 401ns | 2.2ns | 12.2ns | 0 | 0 | 0 | 272 B |
| master | ObjectExtractorSimpleBody |
net472 | 298ns | 0.167ns | 0.648ns | 0.0436 | 0 | 0 | 281 B |
| master | ObjectExtractorMoreComplexBody |
net6.0 | 6.4μs | 30.1ns | 141ns | 0 | 0 | 0 | 3.78 KB |
| master | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.86μs | 29.1ns | 113ns | 0 | 0 | 0 | 3.69 KB |
| master | ObjectExtractorMoreComplexBody |
net472 | 6.67μs | 5.3ns | 19.8ns | 0.602 | 0 | 0 | 3.8 KB |
| #7851 | AllCycleSimpleBody |
net6.0 | 1.06μs | 5.96ns | 40.4ns | 0 | 0 | 0 | 1.22 KB |
| #7851 | AllCycleSimpleBody |
netcoreapp3.1 | 1.41μs | 8.05ns | 60.7ns | 0 | 0 | 0 | 1.2 KB |
| #7851 | AllCycleSimpleBody |
net472 | 1.05μs | 2.52ns | 9.09ns | 0.194 | 0 | 0 | 1.23 KB |
| #7851 | AllCycleMoreComplexBody |
net6.0 | 7.11μs | 33.4ns | 134ns | 0 | 0 | 0 | 4.72 KB |
| #7851 | AllCycleMoreComplexBody |
netcoreapp3.1 | 9.27μs | 42.4ns | 164ns | 0 | 0 | 0 | 4.62 KB |
| #7851 | AllCycleMoreComplexBody |
net472 | 7.67μs | 4.27ns | 16.5ns | 0.727 | 0 | 0 | 4.74 KB |
| #7851 | ObjectExtractorSimpleBody |
net6.0 | 319ns | 1.78ns | 11ns | 0 | 0 | 0 | 280 B |
| #7851 | ObjectExtractorSimpleBody |
netcoreapp3.1 | 396ns | 2.09ns | 11.1ns | 0 | 0 | 0 | 272 B |
| #7851 | ObjectExtractorSimpleBody |
net472 | 300ns | 0.631ns | 2.44ns | 0.0435 | 0 | 0 | 281 B |
| #7851 | ObjectExtractorMoreComplexBody |
net6.0 | 6.32μs | 31.8ns | 149ns | 0 | 0 | 0 | 3.78 KB |
| #7851 | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.92μs | 38.2ns | 162ns | 0 | 0 | 0 | 3.69 KB |
| #7851 | ObjectExtractorMoreComplexBody |
net472 | 6.66μs | 3.36ns | 12.1ns | 0.6 | 0 | 0 | 3.8 KB |
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EncodeArgs |
net6.0 | 76.6μs | 213ns | 796ns | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
netcoreapp3.1 | 96.3μs | 207ns | 774ns | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
net472 | 112μs | 7.66ns | 26.5ns | 5.03 | 0 | 0 | 32.51 KB |
| master | EncodeLegacyArgs |
net6.0 | 145μs | 25.7ns | 99.6ns | 0 | 0 | 0 | 2.15 KB |
| master | EncodeLegacyArgs |
netcoreapp3.1 | 197μs | 83.5ns | 289ns | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
net472 | 264μs | 96ns | 372ns | 0 | 0 | 0 | 2.16 KB |
| #7851 | EncodeArgs |
net6.0 | 76.3μs | 305ns | 1.18μs | 0 | 0 | 0 | 32.4 KB |
| #7851 | EncodeArgs |
netcoreapp3.1 | 95.8μs | 354ns | 1.37μs | 0 | 0 | 0 | 32.4 KB |
| #7851 | EncodeArgs |
net472 | 108μs | 13.6ns | 47.2ns | 4.88 | 0 | 0 | 32.51 KB |
| #7851 | EncodeLegacyArgs |
net6.0 | 142μs | 52.8ns | 205ns | 0 | 0 | 0 | 2.15 KB |
| #7851 | EncodeLegacyArgs |
netcoreapp3.1 | 197μs | 483ns | 1.87μs | 0 | 0 | 0 | 2.14 KB |
| #7851 | EncodeLegacyArgs |
net472 | 263μs | 26.1ns | 101ns | 0 | 0 | 0 | 2.16 KB |
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Fewer allocations 🎉
Fewer allocations 🎉 in #7851
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑net6.0
5.48 KB
5.14 KB
-336 B
-6.13%
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑net6.0
3.5 KB
2.54 KB
-960 B
-27.40%
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑net472
8.19 KB
0 b
-8.19 KB
-100.00%
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑net472
8.19 KB
0 b
-8.19 KB
-100.00%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑net6.0 | 5.48 KB | 5.14 KB | -336 B | -6.13% |
| Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑net6.0 | 3.5 KB | 2.54 KB | -960 B | -27.40% |
| Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑net472 | 8.19 KB | 0 b | -8.19 KB | -100.00% |
| Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑net472 | 8.19 KB | 0 b | -8.19 KB | -100.00% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunWafRealisticBenchmark |
net6.0 | 457μs | 3.08μs | 30.6μs | 0 | 0 | 0 | 5.48 KB |
| master | RunWafRealisticBenchmark |
netcoreapp3.1 | 496μs | 4.32μs | 42.1μs | 0 | 0 | 0 | 4.58 KB |
| master | RunWafRealisticBenchmark |
net472 | 503μs | 607ns | 2.27μs | 0 | 0 | 0 | 8.19 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net6.0 | 311μs | 778ns | 2.81μs | 0 | 0 | 0 | 3.5 KB |
| master | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 352μs | 3.19μs | 31μs | 0 | 0 | 0 | 2.32 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net472 | 371μs | 373ns | 1.29μs | 0 | 0 | 0 | 8.19 KB |
| #7851 | RunWafRealisticBenchmark |
net6.0 | 425μs | 1.11μs | 3.85μs | 0 | 0 | 0 | 5.14 KB |
| #7851 | RunWafRealisticBenchmark |
netcoreapp3.1 | 630μs | 19.5μs | 195μs | 0 | 0 | 0 | 4.58 KB |
| #7851 | RunWafRealisticBenchmark |
net472 | 496μs | 323ns | 1.16μs | 0 | 0 | 0 | 0 b |
| #7851 | RunWafRealisticBenchmarkWithAttack |
net6.0 | 322μs | 1.86μs | 14.7μs | 0 | 0 | 0 | 2.54 KB |
| #7851 | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 335μs | 1.77μs | 8.65μs | 0 | 0 | 0 | 2.32 KB |
| #7851 | RunWafRealisticBenchmarkWithAttack |
net472 | 370μs | 505ns | 1.82μs | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendRequest |
net6.0 | 61.4μs | 113ns | 422ns | 0 | 0 | 0 | 14.52 KB |
| master | SendRequest |
netcoreapp3.1 | 71.1μs | 70.2ns | 253ns | 0 | 0 | 0 | 17.42 KB |
| master | SendRequest |
net472 | 0.00553ns | 0.00212ns | 0.00822ns | 0 | 0 | 0 | 0 b |
| #7851 | SendRequest |
net6.0 | 60.4μs | 59.8ns | 224ns | 0 | 0 | 0 | 14.46 KB |
| #7851 | SendRequest |
netcoreapp3.1 | 71.1μs | 68.2ns | 255ns | 0 | 0 | 0 | 17.36 KB |
| #7851 | SendRequest |
net472 | 0.154ns | 0.0013ns | 0.00469ns | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CharSliceBenchmark - Faster 🎉 More allocations ⚠️
Faster 🎉 in #7851
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑netcoreapp3.1
1.659
2,817,700.00
1,698,100.00
More allocations ⚠️ in #7851
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0
304 B
976 B
672 B
221.05%
Fewer allocations 🎉 in #7851
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0
976 B
304 B
-672 B
-68.85%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net472
8.19 KB
0 b
-8.19 KB
-100.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472
8.19 KB
0 b
-8.19 KB
-100.00%
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑netcoreapp3.1 | 1.659 | 2,817,700.00 | 1,698,100.00 |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 | 304 B | 976 B | 672 B | 221.05% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 | 976 B | 304 B | -672 B | -68.85% |
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net472 | 8.19 KB | 0 b | -8.19 KB | -100.00% |
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472 | 8.19 KB | 0 b | -8.19 KB | -100.00% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | OriginalCharSlice |
net6.0 | 1.89ms | 907ns | 3.51μs | 0 | 0 | 0 | 640.3 KB |
| master | OriginalCharSlice |
netcoreapp3.1 | 3.97ms | 1.68μs | 6.27μs | 0 | 0 | 0 | 640.1 KB |
| master | OriginalCharSlice |
net472 | 2.64ms | 648ns | 2.42μs | 0 | 0 | 0 | 647.17 KB |
| master | OptimizedCharSlice |
net6.0 | 1.4ms | 554ns | 2.07μs | 0 | 0 | 0 | 976 B |
| master | OptimizedCharSlice |
netcoreapp3.1 | 2.82ms | 905ns | 3.39μs | 0 | 0 | 0 | 104 B |
| master | OptimizedCharSlice |
net472 | 1.99ms | 996ns | 3.59μs | 0 | 0 | 0 | 8.19 KB |
| master | OptimizedCharSliceWithPool |
net6.0 | 1.01ms | 347ns | 1.3μs | 0 | 0 | 0 | 304 B |
| master | OptimizedCharSliceWithPool |
netcoreapp3.1 | 2ms | 2.03μs | 7.88μs | 0 | 0 | 0 | 104 B |
| master | OptimizedCharSliceWithPool |
net472 | 1.15ms | 639ns | 2.39μs | 0 | 0 | 0 | 8.19 KB |
| #7851 | OriginalCharSlice |
net6.0 | 1.93ms | 2.28μs | 8.83μs | 0 | 0 | 0 | 640.3 KB |
| #7851 | OriginalCharSlice |
netcoreapp3.1 | 3.89ms | 1.2μs | 4.14μs | 0 | 0 | 0 | 640.1 KB |
| #7851 | OriginalCharSlice |
net472 | 2.55ms | 777ns | 3.01μs | 0 | 0 | 0 | 647.17 KB |
| #7851 | OptimizedCharSlice |
net6.0 | 1.5ms | 875ns | 3.27μs | 0 | 0 | 0 | 304 B |
| #7851 | OptimizedCharSlice |
netcoreapp3.1 | 1.7ms | 5.94μs | 46.4μs | 0 | 0 | 0 | 104 B |
| #7851 | OptimizedCharSlice |
net472 | 2.02ms | 462ns | 1.73μs | 0 | 0 | 0 | 0 b |
| #7851 | OptimizedCharSliceWithPool |
net6.0 | 1.07ms | 702ns | 2.72μs | 0 | 0 | 0 | 976 B |
| #7851 | OptimizedCharSliceWithPool |
netcoreapp3.1 | 1.91ms | 855ns | 3.31μs | 0 | 0 | 0 | 104 B |
| #7851 | OptimizedCharSliceWithPool |
net472 | 1.13ms | 948ns | 3.67μs | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Slower ⚠️ Fewer allocations 🎉
Slower ⚠️ in #7851
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1
1.211
625,569.95
757,523.12
Fewer allocations 🎉 in #7851
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1
41.98 KB
41.73 KB
-248 B
-0.59%
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 1.211 | 625,569.95 | 757,523.12 |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 41.98 KB | 41.73 KB | -248 B | -0.59% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 685μs | 1.86μs | 7.21μs | 0 | 0 | 0 | 41.71 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 627μs | 903ns | 3.5μs | 0 | 0 | 0 | 41.98 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 832μs | 1.3μs | 4.88μs | 8.33 | 0 | 0 | 56.18 KB |
| #7851 | WriteAndFlushEnrichedTraces |
net6.0 | 711μs | 3.79μs | 20.4μs | 0 | 0 | 0 | 41.78 KB |
| #7851 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 750μs | 4.17μs | 25.4μs | 0 | 0 | 0 | 41.73 KB |
| #7851 | WriteAndFlushEnrichedTraces |
net472 | 930μs | 3.13μs | 12.1μs | 8.33 | 0 | 0 | 56.25 KB |
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Fewer allocations 🎉
Fewer allocations 🎉 in #7851
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net6.0
1.02 KB
968 B
-56 B
-5.47%
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑netcoreapp3.1
1.02 KB
960 B
-56 B
-5.51%
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net472
987 B
931 B
-56 B
-5.67%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net6.0 | 1.02 KB | 968 B | -56 B | -5.47% |
| Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑netcoreapp3.1 | 1.02 KB | 960 B | -56 B | -5.51% |
| Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net472 | 987 B | 931 B | -56 B | -5.67% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | ExecuteNonQuery |
net6.0 | 1.93μs | 9.98ns | 47.9ns | 0 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
netcoreapp3.1 | 2.47μs | 11.2ns | 40.5ns | 0 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
net472 | 2.71μs | 1.89ns | 7.31ns | 0.15 | 0 | 0 | 987 B |
| #7851 | ExecuteNonQuery |
net6.0 | 1.87μs | 9.48ns | 41.3ns | 0 | 0 | 0 | 968 B |
| #7851 | ExecuteNonQuery |
netcoreapp3.1 | 2.51μs | 7.97ns | 30.9ns | 0 | 0 | 0 | 960 B |
| #7851 | ExecuteNonQuery |
net472 | 2.65μs | 2.88ns | 11.1ns | 0.147 | 0 | 0 | 931 B |
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Fewer allocations 🎉
Fewer allocations 🎉 in #7851
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net472
1.1 KB
1.04 KB
-56 B
-5.10%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑netcoreapp3.1
1.08 KB
1.02 KB
-56 B
-5.19%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net472
1.04 KB
987 B
-56 B
-5.37%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0
1.03 KB
976 B
-56 B
-5.43%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑netcoreapp3.1
1.03 KB
976 B
-56 B
-5.43%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net6.0
1.01 KB
952 B
-56 B
-5.56%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net472 | 1.1 KB | 1.04 KB | -56 B | -5.10% |
| Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑netcoreapp3.1 | 1.08 KB | 1.02 KB | -56 B | -5.19% |
| Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net472 | 1.04 KB | 987 B | -56 B | -5.37% |
| Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0 | 1.03 KB | 976 B | -56 B | -5.43% |
| Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑netcoreapp3.1 | 1.03 KB | 976 B | -56 B | -5.43% |
| Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net6.0 | 1.01 KB | 952 B | -56 B | -5.56% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | CallElasticsearch |
net6.0 | 1.76μs | 8.03ns | 30ns | 0 | 0 | 0 | 1.03 KB |
| master | CallElasticsearch |
netcoreapp3.1 | 2.23μs | 11.7ns | 56.2ns | 0 | 0 | 0 | 1.03 KB |
| master | CallElasticsearch |
net472 | 3.57μs | 3.38ns | 13.1ns | 0.16 | 0 | 0 | 1.04 KB |
| master | CallElasticsearchAsync |
net6.0 | 1.79μs | 8.33ns | 32.3ns | 0 | 0 | 0 | 1.01 KB |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 2.44μs | 8.58ns | 33.2ns | 0 | 0 | 0 | 1.08 KB |
| master | CallElasticsearchAsync |
net472 | 3.71μs | 1.19ns | 4.6ns | 0.165 | 0 | 0 | 1.1 KB |
| #7851 | CallElasticsearch |
net6.0 | 1.71μs | 6.95ns | 26.9ns | 0 | 0 | 0 | 976 B |
| #7851 | CallElasticsearch |
netcoreapp3.1 | 2.24μs | 4.95ns | 19.2ns | 0 | 0 | 0 | 976 B |
| #7851 | CallElasticsearch |
net472 | 3.49μs | 5.64ns | 21.8ns | 0.14 | 0 | 0 | 987 B |
| #7851 | CallElasticsearchAsync |
net6.0 | 1.8μs | 8.58ns | 35.4ns | 0 | 0 | 0 | 952 B |
| #7851 | CallElasticsearchAsync |
netcoreapp3.1 | 2.4μs | 9.45ns | 35.3ns | 0 | 0 | 0 | 1.02 KB |
| #7851 | CallElasticsearchAsync |
net472 | 3.65μs | 2.62ns | 10.1ns | 0.163 | 0 | 0 | 1.04 KB |
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Fewer allocations 🎉
Fewer allocations 🎉 in #7851
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0
952 B
896 B
-56 B
-5.88%
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑netcoreapp3.1
952 B
896 B
-56 B
-5.88%
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net472
915 B
859 B
-56 B
-6.12%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 | 952 B | 896 B | -56 B | -5.88% |
| Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑netcoreapp3.1 | 952 B | 896 B | -56 B | -5.88% |
| Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net472 | 915 B | 859 B | -56 B | -6.12% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | ExecuteAsync |
net6.0 | 1.82μs | 5.61ns | 21.7ns | 0 | 0 | 0 | 952 B |
| master | ExecuteAsync |
netcoreapp3.1 | 2.35μs | 10.9ns | 43.4ns | 0 | 0 | 0 | 952 B |
| master | ExecuteAsync |
net472 | 2.67μs | 3.16ns | 12.2ns | 0.133 | 0 | 0 | 915 B |
| #7851 | ExecuteAsync |
net6.0 | 1.77μs | 7ns | 26.2ns | 0 | 0 | 0 | 896 B |
| #7851 | ExecuteAsync |
netcoreapp3.1 | 2.4μs | 7.34ns | 28.4ns | 0 | 0 | 0 | 896 B |
| #7851 | ExecuteAsync |
net472 | 2.51μs | 3.95ns | 15.3ns | 0.125 | 0 | 0 | 859 B |
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Fewer allocations 🎉
Fewer allocations 🎉 in #7851
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.HttpClientBenchmark.SendAsync‑net472
3.18 KB
3.12 KB
-56 B
-1.76%
Benchmarks.Trace.HttpClientBenchmark.SendAsync‑netcoreapp3.1
2.9 KB
2.84 KB
-56 B
-1.93%
Benchmarks.Trace.HttpClientBenchmark.SendAsync‑net6.0
2.36 KB
2.3 KB
-56 B
-2.37%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.HttpClientBenchmark.SendAsync‑net472 | 3.18 KB | 3.12 KB | -56 B | -1.76% |
| Benchmarks.Trace.HttpClientBenchmark.SendAsync‑netcoreapp3.1 | 2.9 KB | 2.84 KB | -56 B | -1.93% |
| Benchmarks.Trace.HttpClientBenchmark.SendAsync‑net6.0 | 2.36 KB | 2.3 KB | -56 B | -2.37% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendAsync |
net6.0 | 6.79μs | 10ns | 38.9ns | 0 | 0 | 0 | 2.36 KB |
| master | SendAsync |
netcoreapp3.1 | 8.96μs | 35ns | 135ns | 0 | 0 | 0 | 2.9 KB |
| master | SendAsync |
net472 | 12.2μs | 10.5ns | 40.6ns | 0.488 | 0 | 0 | 3.18 KB |
| #7851 | SendAsync |
net6.0 | 6.69μs | 19.4ns | 75.2ns | 0 | 0 | 0 | 2.3 KB |
| #7851 | SendAsync |
netcoreapp3.1 | 8.77μs | 15.9ns | 61.7ns | 0 | 0 | 0 | 2.84 KB |
| #7851 | SendAsync |
net472 | 12.1μs | 7.04ns | 27.3ns | 0.483 | 0 | 0 | 3.12 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7851
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0
250.62 KB
259.9 KB
9.28 KB
3.70%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0
43.36 KB
43.94 KB
576 B
1.33%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472
278.53 KB
281.3 KB
2.78 KB
1.00%
Fewer allocations 🎉 in #7851
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1
44.04 KB
42.82 KB
-1.22 KB
-2.78%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1
272.86 KB
257.44 KB
-15.42 KB
-5.65%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 250.62 KB | 259.9 KB | 9.28 KB | 3.70% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 | 43.36 KB | 43.94 KB | 576 B | 1.33% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 | 278.53 KB | 281.3 KB | 2.78 KB | 1.00% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 | 44.04 KB | 42.82 KB | -1.22 KB | -2.78% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 | 272.86 KB | 257.44 KB | -15.42 KB | -5.65% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StringConcatBenchmark |
net6.0 | 45μs | 249ns | 1.41μs | 0 | 0 | 0 | 43.36 KB |
| master | StringConcatBenchmark |
netcoreapp3.1 | 48.4μs | 200ns | 720ns | 0 | 0 | 0 | 44.04 KB |
| master | StringConcatBenchmark |
net472 | 57.5μs | 127ns | 459ns | 0 | 0 | 0 | 57.34 KB |
| master | StringConcatAspectBenchmark |
net6.0 | 445μs | 2.37μs | 12.1μs | 0 | 0 | 0 | 250.62 KB |
| master | StringConcatAspectBenchmark |
netcoreapp3.1 | 528μs | 2.53μs | 10.1μs | 0 | 0 | 0 | 272.86 KB |
| master | StringConcatAspectBenchmark |
net472 | 411μs | 2.21μs | 12.5μs | 0 | 0 | 0 | 278.53 KB |
| #7851 | StringConcatBenchmark |
net6.0 | 50μs | 287ns | 1.92μs | 0 | 0 | 0 | 43.94 KB |
| #7851 | StringConcatBenchmark |
netcoreapp3.1 | 52.9μs | 534ns | 5.26μs | 0 | 0 | 0 | 42.82 KB |
| #7851 | StringConcatBenchmark |
net472 | 57.3μs | 146ns | 548ns | 0 | 0 | 0 | 57.34 KB |
| #7851 | StringConcatAspectBenchmark |
net6.0 | 457μs | 950ns | 3.43μs | 0 | 0 | 0 | 259.9 KB |
| #7851 | StringConcatAspectBenchmark |
netcoreapp3.1 | 497μs | 2.44μs | 10μs | 0 | 0 | 0 | 257.44 KB |
| #7851 | StringConcatAspectBenchmark |
net472 | 404μs | 2.13μs | 10.2μs | 0 | 0 | 0 | 281.3 KB |
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net6.0 | 2.64μs | 13.6ns | 67.9ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
netcoreapp3.1 | 3.56μs | 15.7ns | 60.6ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
net472 | 3.82μs | 2.9ns | 11.2ns | 0.245 | 0 | 0 | 1.64 KB |
| #7851 | EnrichedLog |
net6.0 | 2.6μs | 12.9ns | 56ns | 0 | 0 | 0 | 1.7 KB |
| #7851 | EnrichedLog |
netcoreapp3.1 | 3.56μs | 16.2ns | 62.9ns | 0 | 0 | 0 | 1.7 KB |
| #7851 | EnrichedLog |
net472 | 3.77μs | 2.68ns | 10.4ns | 0.245 | 0 | 0 | 1.64 KB |
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net6.0 | 124μs | 129ns | 483ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
netcoreapp3.1 | 127μs | 70.9ns | 256ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
net472 | 168μs | 128ns | 495ns | 0 | 0 | 0 | 4.52 KB |
| #7851 | EnrichedLog |
net6.0 | 123μs | 71.7ns | 258ns | 0 | 0 | 0 | 4.31 KB |
| #7851 | EnrichedLog |
netcoreapp3.1 | 129μs | 98.7ns | 369ns | 0 | 0 | 0 | 4.31 KB |
| #7851 | EnrichedLog |
net472 | 165μs | 141ns | 547ns | 0 | 0 | 0 | 4.51 KB |
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net6.0 | 4.91μs | 23.1ns | 92.4ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
netcoreapp3.1 | 6.93μs | 26.5ns | 103ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
net472 | 7.38μs | 5.92ns | 22.9ns | 0.297 | 0 | 0 | 2.08 KB |
| #7851 | EnrichedLog |
net6.0 | 5.01μs | 23.2ns | 89.8ns | 0 | 0 | 0 | 2.26 KB |
| #7851 | EnrichedLog |
netcoreapp3.1 | 6.79μs | 14.4ns | 54ns | 0 | 0 | 0 | 2.26 KB |
| #7851 | EnrichedLog |
net472 | 7.44μs | 5.68ns | 22ns | 0.295 | 0 | 0 | 2.08 KB |
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Fewer allocations 🎉
Fewer allocations 🎉 in #7851
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.RedisBenchmark.SendReceive‑net6.0
1.2 KB
1.14 KB
-56 B
-4.67%
Benchmarks.Trace.RedisBenchmark.SendReceive‑netcoreapp3.1
1.2 KB
1.14 KB
-56 B
-4.67%
Benchmarks.Trace.RedisBenchmark.SendReceive‑net472
1.2 KB
1.15 KB
-57 B
-4.73%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.RedisBenchmark.SendReceive‑net6.0 | 1.2 KB | 1.14 KB | -56 B | -4.67% |
| Benchmarks.Trace.RedisBenchmark.SendReceive‑netcoreapp3.1 | 1.2 KB | 1.14 KB | -56 B | -4.67% |
| Benchmarks.Trace.RedisBenchmark.SendReceive‑net472 | 1.2 KB | 1.15 KB | -57 B | -4.73% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendReceive |
net6.0 | 1.94μs | 8.91ns | 34.5ns | 0 | 0 | 0 | 1.2 KB |
| master | SendReceive |
netcoreapp3.1 | 2.54μs | 10.8ns | 41.9ns | 0 | 0 | 0 | 1.2 KB |
| master | SendReceive |
net472 | 2.96μs | 2.36ns | 8.82ns | 0.191 | 0 | 0 | 1.2 KB |
| #7851 | SendReceive |
net6.0 | 1.9μs | 9.92ns | 47.6ns | 0 | 0 | 0 | 1.14 KB |
| #7851 | SendReceive |
netcoreapp3.1 | 2.55μs | 8.85ns | 34.3ns | 0 | 0 | 0 | 1.14 KB |
| #7851 | SendReceive |
net472 | 3.03μs | 2.79ns | 10.8ns | 0.167 | 0 | 0 | 1.15 KB |
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net6.0 | 4.29μs | 1.1ns | 4.11ns | 0 | 0 | 0 | 1.58 KB |
| master | EnrichedLog |
netcoreapp3.1 | 5.94μs | 15.6ns | 60.6ns | 0 | 0 | 0 | 1.63 KB |
| master | EnrichedLog |
net472 | 6.55μs | 5.18ns | 20.1ns | 0.293 | 0 | 0 | 2.03 KB |
| #7851 | EnrichedLog |
net6.0 | 4.3μs | 2.86ns | 10.7ns | 0 | 0 | 0 | 1.58 KB |
| #7851 | EnrichedLog |
netcoreapp3.1 | 5.5μs | 20ns | 77.4ns | 0 | 0 | 0 | 1.63 KB |
| #7851 | EnrichedLog |
net472 | 6.38μs | 8.32ns | 32.2ns | 0.32 | 0 | 0 | 2.03 KB |
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Fewer allocations 🎉
Fewer allocations 🎉 in #7851
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0
696 B
640 B
-56 B
-8.05%
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑netcoreapp3.1
696 B
640 B
-56 B
-8.05%
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net472
658 B
602 B
-56 B
-8.51%
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472
578 B
522 B
-56 B
-9.69%
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0
576 B
520 B
-56 B
-9.72%
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1
576 B
520 B
-56 B
-9.72%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 | 696 B | 640 B | -56 B | -8.05% |
| Benchmarks.Trace.SpanBenchmark.StartFinishScope‑netcoreapp3.1 | 696 B | 640 B | -56 B | -8.05% |
| Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net472 | 658 B | 602 B | -56 B | -8.51% |
| Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 | 578 B | 522 B | -56 B | -9.69% |
| Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 | 576 B | 520 B | -56 B | -9.72% |
| Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 | 576 B | 520 B | -56 B | -9.72% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartFinishSpan |
net6.0 | 790ns | 3.61ns | 14.4ns | 0 | 0 | 0 | 576 B |
| master | StartFinishSpan |
netcoreapp3.1 | 960ns | 0.356ns | 1.38ns | 0 | 0 | 0 | 576 B |
| master | StartFinishSpan |
net472 | 917ns | 0.121ns | 0.471ns | 0.0916 | 0 | 0 | 578 B |
| master | StartFinishScope |
net6.0 | 937ns | 0.434ns | 1.68ns | 0 | 0 | 0 | 696 B |
| master | StartFinishScope |
netcoreapp3.1 | 1.13μs | 5.83ns | 26.7ns | 0 | 0 | 0 | 696 B |
| master | StartFinishScope |
net472 | 1.1μs | 0.186ns | 0.721ns | 0.0993 | 0 | 0 | 658 B |
| #7851 | StartFinishSpan |
net6.0 | 731ns | 4.07ns | 24.8ns | 0 | 0 | 0 | 520 B |
| #7851 | StartFinishSpan |
netcoreapp3.1 | 925ns | 4.59ns | 18.9ns | 0 | 0 | 0 | 520 B |
| #7851 | StartFinishSpan |
net472 | 899ns | 0.101ns | 0.377ns | 0.0811 | 0 | 0 | 522 B |
| #7851 | StartFinishScope |
net6.0 | 915ns | 4.52ns | 18.6ns | 0 | 0 | 0 | 640 B |
| #7851 | StartFinishScope |
netcoreapp3.1 | 1.1μs | 5.55ns | 24.2ns | 0 | 0 | 0 | 640 B |
| #7851 | StartFinishScope |
net472 | 1.09μs | 0.813ns | 3.15ns | 0.0927 | 0 | 0 | 602 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Fewer allocations 🎉
Fewer allocations 🎉 in #7851
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0
696 B
640 B
-56 B
-8.05%
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑netcoreapp3.1
696 B
640 B
-56 B
-8.05%
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472
658 B
602 B
-56 B
-8.51%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 | 696 B | 640 B | -56 B | -8.05% |
| Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑netcoreapp3.1 | 696 B | 640 B | -56 B | -8.05% |
| Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472 | 658 B | 602 B | -56 B | -8.51% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunOnMethodBegin |
net6.0 | 1.08μs | 1.43ns | 5.15ns | 0 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 1.38μs | 6.5ns | 25.2ns | 0 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
net472 | 1.44μs | 1.51ns | 5.85ns | 0.101 | 0 | 0 | 658 B |
| #7851 | RunOnMethodBegin |
net6.0 | 1.03μs | 5.67ns | 33.5ns | 0 | 0 | 0 | 640 B |
| #7851 | RunOnMethodBegin |
netcoreapp3.1 | 1.34μs | 6.68ns | 29.1ns | 0 | 0 | 0 | 640 B |
| #7851 | RunOnMethodBegin |
net472 | 1.37μs | 1.23ns | 4.26ns | 0.0898 | 0 | 0 | 602 B |
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7851) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7851) - mean (76ms) : 71, 81
master - mean (76ms) : 70, 83
section Bailout
This PR (7851) - mean (80ms) : 74, 86
master - mean (79ms) : 73, 85
section CallTarget+Inlining+NGEN
This PR (7851) - mean (1,082ms) : 991, 1174
master - mean (1,067ms) : 976, 1158
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7851) - mean (118ms) : 110, 126
master - mean (118ms) : 111, 125
section Bailout
This PR (7851) - mean (120ms) : 112, 128
master - mean (118ms) : 111, 125
section CallTarget+Inlining+NGEN
This PR (7851) - mean (764ms) : 718, 810
master - mean (758ms) : 720, 796
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7851) - mean (106ms) : 100, 112
master - mean (105ms) : 98, 111
section Bailout
This PR (7851) - mean (109ms) : 102, 116
master - mean (107ms) : 100, 114
section CallTarget+Inlining+NGEN
This PR (7851) - mean (716ms) : 665, 767
master - mean (719ms) : 677, 762
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7851) - mean (105ms) : 98, 112
master - mean (106ms) : 98, 114
section Bailout
This PR (7851) - mean (106ms) : 98, 114
master - mean (105ms) : 98, 112
section CallTarget+Inlining+NGEN
This PR (7851) - mean (691ms) : 665, 717
master - mean (690ms) : 661, 720
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7851) - mean (199ms) : 191, 207
master - mean (195ms) : 192, 198
section Bailout
This PR (7851) - mean (203ms) : 195, 210
master - mean (198ms) : 196, 201
section CallTarget+Inlining+NGEN
This PR (7851) - mean (1,180ms) : 1117, 1243
master - mean (1,129ms) : 1071, 1188
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7851) - mean (294ms) : 283, 306
master - mean (280ms) : 276, 285
section Bailout
This PR (7851) - mean (294ms) : 280, 309
master - mean (281ms) : 276, 287
section CallTarget+Inlining+NGEN
This PR (7851) - mean (980ms) : crit, 937, 1023
master - mean (924ms) : 880, 969
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7851) - mean (285ms) : 274, 295
master - mean (274ms) : 267, 280
section Bailout
This PR (7851) - mean (287ms) : 275, 298
master - mean (275ms) : 270, 279
section CallTarget+Inlining+NGEN
This PR (7851) - mean (960ms) : crit, 910, 1010
master - mean (902ms) : 860, 944
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7851) - mean (285ms) : 276, 294
master - mean (273ms) : 267, 278
section Bailout
This PR (7851) - mean (284ms) : 273, 294
master - mean (273ms) : 269, 276
section CallTarget+Inlining+NGEN
This PR (7851) - mean (887ms) : crit, 846, 928
master - mean (839ms) : 813, 865
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2cf4c9f to
49fc046
Compare
|
This reverts commit 9b542fd6b89bfa0b31025d9587fd6f64df8aad03.
bb9b485 to
49883b0
Compare
Summary of changes
Replace
ArraySegment<Span>withSpanCollectionReason for change
ArraySegment<Span>is a wrapper around an array, and by design, always requires allocating an array.However, if we look at the distribution of traces received for processing, we see that 50% of traces only have a single span.
Consequently,
SpanCollectiontakes a similar approach toStringValues, in which it is an abstraction around either a singleSpanor aSpan[]. This means we can avoid allocating the array entirely until we need to.For small traces (with a single span), this saves 56 Bytes per scope/trace or ~8% of the basic trace size. For larger traces,
SpanCollectionandArraySegment<Span>are essentially identical, so the allocation is the same.Given
SpanCollection(andArraySegmentactually) arereadonly struct, also addedinto the signatures (given that both structs are the same size and > pointer size).Implementation details
The changes are essentially:
SpanCollectionholds either aSpanor aSpan[](ornull)StringValuesdoes), as it reduces the size of the struct which brings small perf benefitsinto reduce chance of defensive copiesin/reffields, and can't provide the same functionality as a stubTest coverage
Added some unit tests for the implementation, but the important thing is the benchmarks. We see an 8-8.5% reduction in the allocations for create span/create scope:
Other benchmarks which create a single span see similar improvements.
Note that the two scope benchmark (added in #7869) shows essentially no change (as expected).
Other details
I tried a variety of variations on this approach:
SpanandSpan[]inCountfield (and makeSpanCollectionpointer-sized)