-
Notifications
You must be signed in to change notification settings - Fork 151
Simplify dataflow synchronization #7853
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
BenchmarksBenchmarks Report for benchmark platform 🐌Benchmarks for #7853 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 ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Fewer allocations 🎉
|
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 2.71 KB | 2.7 KB | -15 B | -0.55% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 939μs | 367ns | 1.42μs | 0 | 0 | 0 | 2.7 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.03ms | 552ns | 2.06μs | 0 | 0 | 0 | 2.71 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 1.2ms | 125ns | 484ns | 0 | 0 | 0 | 3.31 KB |
| #7853 | WriteAndFlushEnrichedTraces |
net6.0 | 932μs | 74.7ns | 279ns | 0 | 0 | 0 | 2.7 KB |
| #7853 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.03ms | 212ns | 821ns | 0 | 0 | 0 | 2.7 KB |
| #7853 | WriteAndFlushEnrichedTraces |
net472 | 1.2ms | 210ns | 787ns | 0 | 0 | 0 | 3.31 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.12μs | 0.877ns | 3.4ns | 0 | 0 | 0 | 1.22 KB |
| master | AllCycleSimpleBody |
netcoreapp3.1 | 1.42μs | 7.76ns | 43.9ns | 0 | 0 | 0 | 1.2 KB |
| master | AllCycleSimpleBody |
net472 | 1.02μs | 2.6ns | 10.1ns | 0.192 | 0 | 0 | 1.23 KB |
| master | AllCycleMoreComplexBody |
net6.0 | 7.24μs | 32.3ns | 125ns | 0 | 0 | 0 | 4.72 KB |
| master | AllCycleMoreComplexBody |
netcoreapp3.1 | 9.06μs | 43.5ns | 179ns | 0 | 0 | 0 | 4.62 KB |
| master | AllCycleMoreComplexBody |
net472 | 7.57μs | 4.62ns | 17.9ns | 0.721 | 0 | 0 | 4.74 KB |
| master | ObjectExtractorSimpleBody |
net6.0 | 326ns | 1.75ns | 9.43ns | 0 | 0 | 0 | 280 B |
| master | ObjectExtractorSimpleBody |
netcoreapp3.1 | 418ns | 2.38ns | 15.9ns | 0 | 0 | 0 | 272 B |
| master | ObjectExtractorSimpleBody |
net472 | 298ns | 0.0238ns | 0.0857ns | 0.0439 | 0 | 0 | 281 B |
| master | ObjectExtractorMoreComplexBody |
net6.0 | 6.34μs | 29.8ns | 115ns | 0 | 0 | 0 | 3.78 KB |
| master | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.91μs | 36.3ns | 141ns | 0 | 0 | 0 | 3.69 KB |
| master | ObjectExtractorMoreComplexBody |
net472 | 6.7μs | 9.57ns | 37.1ns | 0.6 | 0 | 0 | 3.8 KB |
| #7853 | AllCycleSimpleBody |
net6.0 | 1.07μs | 0.377ns | 1.41ns | 0 | 0 | 0 | 1.22 KB |
| #7853 | AllCycleSimpleBody |
netcoreapp3.1 | 1.42μs | 0.531ns | 1.84ns | 0 | 0 | 0 | 1.2 KB |
| #7853 | AllCycleSimpleBody |
net472 | 1.02μs | 0.512ns | 1.98ns | 0.194 | 0 | 0 | 1.23 KB |
| #7853 | AllCycleMoreComplexBody |
net6.0 | 7.14μs | 38.7ns | 209ns | 0 | 0 | 0 | 4.72 KB |
| #7853 | AllCycleMoreComplexBody |
netcoreapp3.1 | 9.03μs | 42.8ns | 166ns | 0 | 0 | 0 | 4.62 KB |
| #7853 | AllCycleMoreComplexBody |
net472 | 7.59μs | 4.56ns | 17.7ns | 0.721 | 0 | 0 | 4.74 KB |
| #7853 | ObjectExtractorSimpleBody |
net6.0 | 326ns | 1.67ns | 7.47ns | 0 | 0 | 0 | 280 B |
| #7853 | ObjectExtractorSimpleBody |
netcoreapp3.1 | 405ns | 0.13ns | 0.504ns | 0 | 0 | 0 | 272 B |
| #7853 | ObjectExtractorSimpleBody |
net472 | 294ns | 0.0337ns | 0.13ns | 0.0443 | 0 | 0 | 281 B |
| #7853 | ObjectExtractorMoreComplexBody |
net6.0 | 6.25μs | 30.4ns | 133ns | 0 | 0 | 0 | 3.78 KB |
| #7853 | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.88μs | 4.04ns | 15.7ns | 0 | 0 | 0 | 3.69 KB |
| #7853 | ObjectExtractorMoreComplexBody |
net472 | 6.76μs | 9.39ns | 36.4ns | 0.572 | 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.9μs | 24ns | 89.7ns | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
netcoreapp3.1 | 96.2μs | 276ns | 1.07μs | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
net472 | 118μs | 17.2ns | 66.5ns | 4.69 | 0 | 0 | 32.5 KB |
| master | EncodeLegacyArgs |
net6.0 | 147μs | 38.7ns | 145ns | 0 | 0 | 0 | 2.15 KB |
| master | EncodeLegacyArgs |
netcoreapp3.1 | 199μs | 348ns | 1.35μs | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
net472 | 267μs | 28ns | 108ns | 0 | 0 | 0 | 2.16 KB |
| #7853 | EncodeArgs |
net6.0 | 76.5μs | 303ns | 1.17μs | 0 | 0 | 0 | 32.4 KB |
| #7853 | EncodeArgs |
netcoreapp3.1 | 97μs | 123ns | 425ns | 0 | 0 | 0 | 32.4 KB |
| #7853 | EncodeArgs |
net472 | 109μs | 9.7ns | 33.6ns | 4.91 | 0 | 0 | 32.51 KB |
| #7853 | EncodeLegacyArgs |
net6.0 | 152μs | 18.6ns | 72ns | 0 | 0 | 0 | 2.15 KB |
| #7853 | EncodeLegacyArgs |
netcoreapp3.1 | 197μs | 50.4ns | 175ns | 0 | 0 | 0 | 2.14 KB |
| #7853 | EncodeLegacyArgs |
net472 | 265μs | 31.7ns | 110ns | 0 | 0 | 0 | 2.16 KB |
Benchmarks.Trace.Asm.AppSecWafBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #7853
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1
2.081
410,850.94
855,141.73
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1 | 2.081 | 410,850.94 | 855,141.73 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunWafRealisticBenchmark |
net6.0 | 397μs | 76ns | 274ns | 0 | 0 | 0 | 4.55 KB |
| master | RunWafRealisticBenchmark |
netcoreapp3.1 | 411μs | 285ns | 1.07μs | 0 | 0 | 0 | 4.48 KB |
| master | RunWafRealisticBenchmark |
net472 | 427μs | 63.3ns | 245ns | 0 | 0 | 0 | 4.66 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net6.0 | 284μs | 41.3ns | 160ns | 0 | 0 | 0 | 2.24 KB |
| master | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 298μs | 62.7ns | 226ns | 0 | 0 | 0 | 2.22 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net472 | 311μs | 21.9ns | 85ns | 0 | 0 | 0 | 2.29 KB |
| #7853 | RunWafRealisticBenchmark |
net6.0 | 391μs | 48.7ns | 189ns | 0 | 0 | 0 | 4.56 KB |
| #7853 | RunWafRealisticBenchmark |
netcoreapp3.1 | 820μs | 12μs | 117μs | 0 | 0 | 0 | 4.48 KB |
| #7853 | RunWafRealisticBenchmark |
net472 | 431μs | 65.2ns | 253ns | 0 | 0 | 0 | 4.66 KB |
| #7853 | RunWafRealisticBenchmarkWithAttack |
net6.0 | 285μs | 45.2ns | 175ns | 0 | 0 | 0 | 2.24 KB |
| #7853 | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 299μs | 70.8ns | 265ns | 0 | 0 | 0 | 2.22 KB |
| #7853 | RunWafRealisticBenchmarkWithAttack |
net472 | 310μs | 29.1ns | 113ns | 0 | 0 | 0 | 2.29 KB |
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μs | 72.2ns | 279ns | 0 | 0 | 0 | 14.52 KB |
| master | SendRequest |
netcoreapp3.1 | 70.8μs | 66ns | 247ns | 0 | 0 | 0 | 17.42 KB |
| master | SendRequest |
net472 | 0.00512ns | 0.00217ns | 0.00841ns | 0 | 0 | 0 | 0 b |
| #7853 | SendRequest |
net6.0 | 60.7μs | 52.4ns | 196ns | 0 | 0 | 0 | 14.52 KB |
| #7853 | SendRequest |
netcoreapp3.1 | 71.1μs | 331ns | 1.66μs | 0 | 0 | 0 | 17.42 KB |
| #7853 | SendRequest |
net472 | 0.00357ns | 0.0016ns | 0.0062ns | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CharSliceBenchmark - Slower ⚠️ More allocations ⚠️
Slower ⚠️ in #7853
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1
1.143
808,670.90
924,592.50
More allocations ⚠️ in #7853
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑netcoreapp3.1
1 B
32 B
31 B
3,100.00%
Fewer allocations 🎉 in #7853
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0
4 B
3 B
-1 B
-25.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0
7 B
2 B
-5 B
-71.43%
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1 | 1.143 | 808,670.90 | 924,592.50 |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑netcoreapp3.1 | 1 B | 32 B | 31 B | 3,100.00% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 | 4 B | 3 B | -1 B | -25.00% |
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 | 7 B | 2 B | -5 B | -71.43% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | OriginalCharSlice |
net6.0 | 1.96ms | 5.54μs | 21.4μs | 0 | 0 | 0 | 640.01 KB |
| master | OriginalCharSlice |
netcoreapp3.1 | 2.08ms | 2.29μs | 8.25μs | 0 | 0 | 0 | 640 KB |
| master | OriginalCharSlice |
net472 | 2.72ms | 130ns | 504ns | 100 | 0 | 0 | 641.95 KB |
| master | OptimizedCharSlice |
net6.0 | 1.35ms | 290ns | 1.05μs | 0 | 0 | 0 | 7 B |
| master | OptimizedCharSlice |
netcoreapp3.1 | 1.66ms | 498ns | 1.93μs | 0 | 0 | 0 | 1 B |
| master | OptimizedCharSlice |
net472 | 1.99ms | 418ns | 1.62μs | 0 | 0 | 0 | 73 B |
| master | OptimizedCharSliceWithPool |
net6.0 | 849μs | 60.4ns | 218ns | 0 | 0 | 0 | 4 B |
| master | OptimizedCharSliceWithPool |
netcoreapp3.1 | 809μs | 37.6ns | 136ns | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net472 | 1.15ms | 124ns | 482ns | 0 | 0 | 0 | 47 B |
| #7853 | OriginalCharSlice |
net6.0 | 1.91ms | 2.74μs | 10.3μs | 0 | 0 | 0 | 640.01 KB |
| #7853 | OriginalCharSlice |
netcoreapp3.1 | 2.18ms | 5.68μs | 20.5μs | 0 | 0 | 0 | 640 KB |
| #7853 | OriginalCharSlice |
net472 | 2.62ms | 620ns | 2.32μs | 100 | 0 | 0 | 641.95 KB |
| #7853 | OptimizedCharSlice |
net6.0 | 1.34ms | 593ns | 2.3μs | 0 | 0 | 0 | 2 B |
| #7853 | OptimizedCharSlice |
netcoreapp3.1 | 1.73ms | 372ns | 1.44μs | 0 | 0 | 0 | 32 B |
| #7853 | OptimizedCharSlice |
net472 | 1.93ms | 273ns | 1.06μs | 0 | 0 | 0 | 73 B |
| #7853 | OptimizedCharSliceWithPool |
net6.0 | 876μs | 55.2ns | 214ns | 0 | 0 | 0 | 3 B |
| #7853 | OptimizedCharSliceWithPool |
netcoreapp3.1 | 925μs | 56ns | 217ns | 0 | 0 | 0 | 0 b |
| #7853 | OptimizedCharSliceWithPool |
net472 | 1.25ms | 229ns | 885ns | 0 | 0 | 0 | 47 B |
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7853
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1
42.07 KB
42.85 KB
776 B
1.84%
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0
41.54 KB
41.91 KB
367 B
0.88%
Fewer allocations 🎉 in #7853
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472
56.5 KB
55.93 KB
-578 B
-1.02%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 42.07 KB | 42.85 KB | 776 B | 1.84% |
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 | 41.54 KB | 41.91 KB | 367 B | 0.88% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 | 56.5 KB | 55.93 KB | -578 B | -1.02% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 716μs | 3.07μs | 11.9μs | 0 | 0 | 0 | 41.54 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 755μs | 4.85μs | 46.5μs | 0 | 0 | 0 | 42.07 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 866μs | 3.74μs | 14μs | 8.93 | 0 | 0 | 56.5 KB |
| #7853 | WriteAndFlushEnrichedTraces |
net6.0 | 695μs | 3.91μs | 26.2μs | 0 | 0 | 0 | 41.91 KB |
| #7853 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 773μs | 3.56μs | 17.8μs | 0 | 0 | 0 | 42.85 KB |
| #7853 | WriteAndFlushEnrichedTraces |
net472 | 900μs | 2.77μs | 10.4μs | 4.46 | 0 | 0 | 55.93 KB |
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | ExecuteNonQuery |
net6.0 | 1.89μs | 1.66ns | 6.43ns | 0 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
netcoreapp3.1 | 2.62μs | 8.01ns | 31ns | 0 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
net472 | 3.03μs | 3.89ns | 15.1ns | 0.152 | 0.0152 | 0 | 987 B |
| #7853 | ExecuteNonQuery |
net6.0 | 1.91μs | 8.72ns | 32.6ns | 0 | 0 | 0 | 1.02 KB |
| #7853 | ExecuteNonQuery |
netcoreapp3.1 | 2.55μs | 6.97ns | 26.1ns | 0 | 0 | 0 | 1.02 KB |
| #7853 | ExecuteNonQuery |
net472 | 2.87μs | 2.11ns | 8.16ns | 0.157 | 0.0142 | 0 | 987 B |
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | CallElasticsearch |
net6.0 | 1.72μs | 0.731ns | 2.83ns | 0 | 0 | 0 | 1.03 KB |
| master | CallElasticsearch |
netcoreapp3.1 | 2.29μs | 7.79ns | 30.2ns | 0 | 0 | 0 | 1.03 KB |
| master | CallElasticsearch |
net472 | 3.59μs | 6.94ns | 26.9ns | 0.16 | 0 | 0 | 1.04 KB |
| master | CallElasticsearchAsync |
net6.0 | 1.82μs | 5.68ns | 22ns | 0 | 0 | 0 | 1.01 KB |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 2.44μs | 11.9ns | 51.9ns | 0 | 0 | 0 | 1.08 KB |
| master | CallElasticsearchAsync |
net472 | 3.79μs | 4.34ns | 16.8ns | 0.17 | 0 | 0 | 1.1 KB |
| #7853 | CallElasticsearch |
net6.0 | 1.75μs | 6.7ns | 24.2ns | 0 | 0 | 0 | 1.03 KB |
| #7853 | CallElasticsearch |
netcoreapp3.1 | 2.23μs | 11.3ns | 51.9ns | 0 | 0 | 0 | 1.03 KB |
| #7853 | CallElasticsearch |
net472 | 3.55μs | 4.32ns | 16.7ns | 0.161 | 0 | 0 | 1.04 KB |
| #7853 | CallElasticsearchAsync |
net6.0 | 1.78μs | 7.71ns | 29.9ns | 0 | 0 | 0 | 1.01 KB |
| #7853 | CallElasticsearchAsync |
netcoreapp3.1 | 2.36μs | 10.3ns | 39.8ns | 0 | 0 | 0 | 1.08 KB |
| #7853 | CallElasticsearchAsync |
net472 | 3.83μs | 3.96ns | 15.4ns | 0.172 | 0 | 0 | 1.1 KB |
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | ExecuteAsync |
net6.0 | 1.85μs | 8.98ns | 35.9ns | 0 | 0 | 0 | 952 B |
| master | ExecuteAsync |
netcoreapp3.1 | 2.44μs | 1.79ns | 6.68ns | 0 | 0 | 0 | 952 B |
| master | ExecuteAsync |
net472 | 2.58μs | 4.33ns | 16.8ns | 0.141 | 0 | 0 | 915 B |
| #7853 | ExecuteAsync |
net6.0 | 1.87μs | 8.39ns | 31.4ns | 0 | 0 | 0 | 952 B |
| #7853 | ExecuteAsync |
netcoreapp3.1 | 2.51μs | 11.6ns | 46.4ns | 0 | 0 | 0 | 952 B |
| #7853 | ExecuteAsync |
net472 | 2.53μs | 0.662ns | 2.56ns | 0.139 | 0 | 0 | 915 B |
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendAsync |
net6.0 | 6.77μs | 4.53ns | 16.9ns | 0 | 0 | 0 | 2.36 KB |
| master | SendAsync |
netcoreapp3.1 | 8.65μs | 27.9ns | 108ns | 0 | 0 | 0 | 2.9 KB |
| master | SendAsync |
net472 | 12.6μs | 5.72ns | 20.6ns | 0.505 | 0 | 0 | 3.18 KB |
| #7853 | SendAsync |
net6.0 | 7.15μs | 11.6ns | 44.9ns | 0 | 0 | 0 | 2.36 KB |
| #7853 | SendAsync |
netcoreapp3.1 | 9μs | 26.5ns | 103ns | 0 | 0 | 0 | 2.9 KB |
| #7853 | SendAsync |
net472 | 11.9μs | 9.59ns | 37.1ns | 0.477 | 0 | 0 | 3.18 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7853
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1
257.18 KB
273.11 KB
15.94 KB
6.20%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472
274.06 KB
276.59 KB
2.53 KB
0.92%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0
43.97 KB
44.3 KB
328 B
0.75%
Fewer allocations 🎉 in #7853
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1
43.22 KB
42.76 KB
-456 B
-1.06%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 | 257.18 KB | 273.11 KB | 15.94 KB | 6.20% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 | 274.06 KB | 276.59 KB | 2.53 KB | 0.92% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 | 43.97 KB | 44.3 KB | 328 B | 0.75% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 | 43.22 KB | 42.76 KB | -456 B | -1.06% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StringConcatBenchmark |
net6.0 | 46.5μs | 276ns | 2.66μs | 0 | 0 | 0 | 43.97 KB |
| master | StringConcatBenchmark |
netcoreapp3.1 | 49.8μs | 257ns | 1.63μs | 0 | 0 | 0 | 43.22 KB |
| master | StringConcatBenchmark |
net472 | 57.8μs | 286ns | 1.18μs | 0 | 0 | 0 | 57.34 KB |
| master | StringConcatAspectBenchmark |
net6.0 | 469μs | 1.99μs | 7.18μs | 0 | 0 | 0 | 276.89 KB |
| master | StringConcatAspectBenchmark |
netcoreapp3.1 | 524μs | 2.19μs | 7.91μs | 0 | 0 | 0 | 257.18 KB |
| master | StringConcatAspectBenchmark |
net472 | 410μs | 1.88μs | 9.78μs | 0 | 0 | 0 | 274.06 KB |
| #7853 | StringConcatBenchmark |
net6.0 | 44.3μs | 227ns | 1.07μs | 0 | 0 | 0 | 44.3 KB |
| #7853 | StringConcatBenchmark |
netcoreapp3.1 | 54.3μs | 753ns | 7.38μs | 0 | 0 | 0 | 42.76 KB |
| #7853 | StringConcatBenchmark |
net472 | 57.1μs | 208ns | 750ns | 0 | 0 | 0 | 57.34 KB |
| #7853 | StringConcatAspectBenchmark |
net6.0 | 492μs | 2.33μs | 11.9μs | 0 | 0 | 0 | 277.23 KB |
| #7853 | StringConcatAspectBenchmark |
netcoreapp3.1 | 504μs | 1.5μs | 5.41μs | 0 | 0 | 0 | 273.11 KB |
| #7853 | StringConcatAspectBenchmark |
net472 | 411μs | 2.27μs | 14.4μs | 0 | 0 | 0 | 276.59 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.7μs | 14.6ns | 83.7ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
netcoreapp3.1 | 3.63μs | 12.2ns | 47.3ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
net472 | 4.01μs | 2.3ns | 8.91ns | 0.26 | 0 | 0 | 1.64 KB |
| #7853 | EnrichedLog |
net6.0 | 2.69μs | 1.98ns | 7.68ns | 0 | 0 | 0 | 1.7 KB |
| #7853 | EnrichedLog |
netcoreapp3.1 | 3.64μs | 3.67ns | 14.2ns | 0 | 0 | 0 | 1.7 KB |
| #7853 | EnrichedLog |
net472 | 3.95μs | 3.02ns | 11.7ns | 0.256 | 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 | 122μs | 49.2ns | 190ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
netcoreapp3.1 | 128μs | 209ns | 809ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
net472 | 169μs | 75.6ns | 293ns | 0 | 0 | 0 | 4.52 KB |
| #7853 | EnrichedLog |
net6.0 | 123μs | 55ns | 206ns | 0 | 0 | 0 | 4.31 KB |
| #7853 | EnrichedLog |
netcoreapp3.1 | 128μs | 176ns | 658ns | 0 | 0 | 0 | 4.31 KB |
| #7853 | EnrichedLog |
net472 | 167μs | 147ns | 569ns | 0 | 0 | 0 | 4.52 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.88μs | 20.8ns | 80.8ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
netcoreapp3.1 | 6.8μs | 17.1ns | 66.3ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
net472 | 7.49μs | 4.38ns | 17ns | 0.3 | 0 | 0 | 2.08 KB |
| #7853 | EnrichedLog |
net6.0 | 4.9μs | 5.79ns | 21.6ns | 0 | 0 | 0 | 2.26 KB |
| #7853 | EnrichedLog |
netcoreapp3.1 | 6.98μs | 25.1ns | 97.2ns | 0 | 0 | 0 | 2.26 KB |
| #7853 | EnrichedLog |
net472 | 7.7μs | 6.82ns | 25.5ns | 0.31 | 0 | 0 | 2.08 KB |
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendReceive |
net6.0 | 1.94μs | 10.2ns | 50ns | 0 | 0 | 0 | 1.2 KB |
| master | SendReceive |
netcoreapp3.1 | 2.56μs | 12.5ns | 48.4ns | 0 | 0 | 0 | 1.2 KB |
| master | SendReceive |
net472 | 3.01μs | 3.07ns | 11.5ns | 0.183 | 0 | 0 | 1.2 KB |
| #7853 | SendReceive |
net6.0 | 1.96μs | 9.28ns | 36ns | 0 | 0 | 0 | 1.2 KB |
| #7853 | SendReceive |
netcoreapp3.1 | 2.57μs | 13.3ns | 62.2ns | 0 | 0 | 0 | 1.2 KB |
| #7853 | SendReceive |
net472 | 3.19μs | 2.55ns | 9.53ns | 0.176 | 0 | 0 | 1.2 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.34μs | 6.48ns | 25.1ns | 0 | 0 | 0 | 1.58 KB |
| master | EnrichedLog |
netcoreapp3.1 | 5.54μs | 17.2ns | 66.8ns | 0 | 0 | 0 | 1.63 KB |
| master | EnrichedLog |
net472 | 6.83μs | 7.27ns | 28.2ns | 0.307 | 0 | 0 | 2.03 KB |
| #7853 | EnrichedLog |
net6.0 | 4.3μs | 10.7ns | 40ns | 0 | 0 | 0 | 1.58 KB |
| #7853 | EnrichedLog |
netcoreapp3.1 | 5.77μs | 13.4ns | 51.8ns | 0 | 0 | 0 | 1.63 KB |
| #7853 | EnrichedLog |
net472 | 6.77μs | 9.23ns | 35.7ns | 0.302 | 0 | 0 | 2.03 KB |
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartFinishSpan |
net6.0 | 769ns | 4.17ns | 25ns | 0 | 0 | 0 | 576 B |
| master | StartFinishSpan |
netcoreapp3.1 | 961ns | 5.1ns | 25.5ns | 0 | 0 | 0 | 576 B |
| master | StartFinishSpan |
net472 | 974ns | 0.344ns | 1.33ns | 0.0883 | 0 | 0 | 578 B |
| master | StartFinishScope |
net6.0 | 902ns | 4.53ns | 20.7ns | 0 | 0 | 0 | 696 B |
| master | StartFinishScope |
netcoreapp3.1 | 1.17μs | 5.91ns | 27.7ns | 0 | 0 | 0 | 696 B |
| master | StartFinishScope |
net472 | 1.18μs | 0.388ns | 1.5ns | 0.0996 | 0 | 0 | 658 B |
| #7853 | StartFinishSpan |
net6.0 | 781ns | 4.16ns | 22.4ns | 0 | 0 | 0 | 576 B |
| #7853 | StartFinishSpan |
netcoreapp3.1 | 951ns | 5.11ns | 26.5ns | 0 | 0 | 0 | 576 B |
| #7853 | StartFinishSpan |
net472 | 950ns | 0.46ns | 1.78ns | 0.0902 | 0 | 0 | 578 B |
| #7853 | StartFinishScope |
net6.0 | 947ns | 5.24ns | 30.6ns | 0 | 0 | 0 | 696 B |
| #7853 | StartFinishScope |
netcoreapp3.1 | 1.19μs | 6.15ns | 30.8ns | 0 | 0 | 0 | 696 B |
| #7853 | StartFinishScope |
net472 | 1.18μs | 0.768ns | 2.97ns | 0.0997 | 0 | 0 | 658 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunOnMethodBegin |
net6.0 | 1.07μs | 5.21ns | 22.1ns | 0 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 1.5μs | 7.08ns | 30ns | 0 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
net472 | 1.43μs | 0.251ns | 0.938ns | 0.1 | 0 | 0 | 658 B |
| #7853 | RunOnMethodBegin |
net6.0 | 1.09μs | 5.08ns | 20.3ns | 0 | 0 | 0 | 696 B |
| #7853 | RunOnMethodBegin |
netcoreapp3.1 | 1.49μs | 7.19ns | 31.3ns | 0 | 0 | 0 | 696 B |
| #7853 | RunOnMethodBegin |
net472 | 1.43μs | 0.362ns | 1.31ns | 0.101 | 0 | 0 | 658 B |
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7853) 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 (7853) - mean (77ms) : 71, 84
master - mean (77ms) : 70, 84
section Bailout
This PR (7853) - mean (82ms) : 73, 90
master - mean (82ms) : 75, 88
section CallTarget+Inlining+NGEN
This PR (7853) - mean (1,100ms) : 996, 1203
master - mean (1,096ms) : 989, 1204
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 (7853) - mean (121ms) : 110, 132
master - mean (120ms) : 111, 128
section Bailout
This PR (7853) - mean (122ms) : 112, 131
master - mean (122ms) : 112, 133
section CallTarget+Inlining+NGEN
This PR (7853) - mean (780ms) : 723, 837
master - mean (771ms) : 732, 809
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7853) - mean (109ms) : 99, 118
master - mean (107ms) : 100, 115
section Bailout
This PR (7853) - mean (110ms) : 102, 119
master - mean (107ms) : 99, 115
section CallTarget+Inlining+NGEN
This PR (7853) - mean (725ms) : 680, 770
master - mean (716ms) : 660, 772
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7853) - mean (107ms) : 97, 118
master - mean (107ms) : 98, 115
section Bailout
This PR (7853) - mean (110ms) : 100, 119
master - mean (106ms) : 99, 114
section CallTarget+Inlining+NGEN
This PR (7853) - mean (699ms) : 667, 732
master - mean (705ms) : 663, 748
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 (7853) - mean (195ms) : 191, 199
master - mean (195ms) : 190, 199
section Bailout
This PR (7853) - mean (198ms) : 196, 200
master - mean (198ms) : 195, 200
section CallTarget+Inlining+NGEN
This PR (7853) - mean (1,126ms) : 1051, 1201
master - mean (1,132ms) : 1048, 1216
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 (7853) - mean (280ms) : 275, 285
master - mean (283ms) : 271, 295
section Bailout
This PR (7853) - mean (280ms) : 276, 284
master - mean (284ms) : 274, 293
section CallTarget+Inlining+NGEN
This PR (7853) - mean (922ms) : 875, 968
master - mean (922ms) : 872, 972
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7853) - mean (273ms) : 265, 280
master - mean (271ms) : 266, 276
section Bailout
This PR (7853) - mean (274ms) : 267, 280
master - mean (276ms) : 266, 286
section CallTarget+Inlining+NGEN
This PR (7853) - mean (895ms) : 849, 941
master - mean (900ms) : 853, 947
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7853) - mean (270ms) : 266, 274
master - mean (274ms) : 266, 283
section Bailout
This PR (7853) - mean (271ms) : 267, 276
master - mean (272ms) : 267, 276
section CallTarget+Inlining+NGEN
This PR (7853) - mean (829ms) : 807, 851
master - mean (839ms) : 801, 877
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||
| _dataflow = dataflow; | ||
| } | ||
| return aspectsLength; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If _dataflow != null for some reason, then we wont "save" the dataflow values, and we might return the wrong number of aspectsLength here, right? 🤔
It seems like we should probably move this check right to the top of the method and/or ensure can't be non-null when this method is called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. On it
Co-authored-by: Andrew Lock <[email protected]>
Summary of changes
This PR simplifies the lifecycle and usage of iast::Dataflow within the .NET tracer by removing unnecessary synchronization complexity and consolidating initialization logic. After validating that the profiler’s lifecycle guarantees make the race condition targeted in #7838 impossible, the extra locking and state checks introduced there were identified as unnecessary. This PR therefore removes them and replaces them with a clearer, more maintainable initialization model.
The end result is the same runtime behavior, but with cleaner, more predictable code paths.
Reason for change
During investigation of the suspected race in Dataflow, we discovered:
_dataflow is created before any IAST-related callbacks can run.
_dataflow is destroyed only during CorProfiler::Shutdown, after all runtime callbacks have stopped.
Therefore, there is no window where runtime threads can access a partially-initialized or null Dataflow instance.
Because the profiler’s lifecycle already prevents the problematic interleavings, the additional locking and defensive checks from #7838 were redundant. They increased complexity without improving correctness.
This PR cleans that up.
Implementation details
What this PR does
Dataflow::LoadAspects becomes the single, authoritative entry point for initialization. No scattered flags, no duplicated checks.
Since lifecycle guarantees prevent concurrent initialization, the critical-section guarding and initialization state added in #7838 are removed.
Profiler callbacks (ModuleLoaded, ModuleUnloaded, IAST instrumentation setup, etc.) now:
Assume _dataflow exists.
Only guard the internal data structures that are actually accessed concurrently.
Remove early-return branches and over-defensive locking patterns.
Any state variables, flags, or locking constructs made obsolete by the simplified lifecycle are removed, shrinking the Dataflow class footprint.
Result
Same behavioral correctness.
Fewer code paths and edge cases.
Clearer lifecycle contract: Dataflow always exists during the period where callbacks may use it.
Easier to maintain and reason about for future IAST development.
Test coverage
Re-ran IAST tests on Windows x86/x64 to confirm no regressions.
Validated profiler lifecycle behavior to ensure _dataflow is always valid during runtime callbacks.
Confirmed no reappearance of previous intermittent failures.
Other details