-
Notifications
You must be signed in to change notification settings - Fork 150
Fixing DSM flush logic & CPU usage #7827
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
Fixing DSM flush logic & CPU usage #7827
Conversation
This comment has been minimized.
This comment has been minimized.
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7827) 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 (7827) - mean (77ms) : 72, 82
master - mean (76ms) : 69, 83
section Bailout
This PR (7827) - mean (80ms) : 75, 86
master - mean (82ms) : 74, 90
section CallTarget+Inlining+NGEN
This PR (7827) - mean (1,079ms) : 1022, 1136
master - mean (1,074ms) : 1003, 1144
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 (7827) - mean (119ms) : 111, 127
master - mean (120ms) : 112, 129
section Bailout
This PR (7827) - mean (121ms) : 113, 129
master - mean (121ms) : 113, 130
section CallTarget+Inlining+NGEN
This PR (7827) - mean (770ms) : 735, 805
master - mean (766ms) : 730, 802
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7827) - mean (106ms) : 97, 115
master - mean (106ms) : 97, 114
section Bailout
This PR (7827) - mean (108ms) : 99, 118
master - mean (106ms) : 97, 116
section CallTarget+Inlining+NGEN
This PR (7827) - mean (720ms) : 684, 755
master - mean (715ms) : 684, 747
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7827) - mean (107ms) : 98, 116
master - mean (106ms) : 96, 115
section Bailout
This PR (7827) - mean (106ms) : 98, 114
master - mean (106ms) : 99, 113
section CallTarget+Inlining+NGEN
This PR (7827) - mean (698ms) : 666, 731
master - mean (686ms) : 654, 719
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 (7827) - mean (193ms) : 189, 196
master - mean (194ms) : 188, 200
section Bailout
This PR (7827) - mean (196ms) : 194, 198
master - mean (199ms) : 194, 205
section CallTarget+Inlining+NGEN
This PR (7827) - mean (1,133ms) : 1058, 1207
master - mean (1,133ms) : 1068, 1197
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 (7827) - mean (278ms) : 272, 284
master - mean (282ms) : 274, 290
section Bailout
This PR (7827) - mean (280ms) : 274, 286
master - mean (281ms) : 273, 288
section CallTarget+Inlining+NGEN
This PR (7827) - mean (921ms) : 868, 975
master - mean (920ms) : 864, 976
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7827) - mean (274ms) : 264, 284
master - mean (276ms) : 266, 285
section Bailout
This PR (7827) - mean (273ms) : 265, 280
master - mean (272ms) : 266, 278
section CallTarget+Inlining+NGEN
This PR (7827) - mean (895ms) : 846, 943
master - mean (884ms) : 845, 924
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7827) - mean (272ms) : 265, 278
master - mean (271ms) : 264, 278
section Bailout
This PR (7827) - mean (271ms) : 265, 278
master - mean (274ms) : 265, 284
section CallTarget+Inlining+NGEN
This PR (7827) - mean (845ms) : 808, 883
master - mean (836ms) : 810, 862
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BenchmarksBenchmarks Report for benchmark platform 🐌Benchmarks for #7827 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‑netcoreapp3.1 | 5.57 KB | 5.71 KB | 140 B | 2.51% |
| Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 | 5.94 KB | 6.03 KB | 93 B | 1.57% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartStopWithChild |
net6.0 | 10.7μs | 60.2ns | 395ns | 0 | 0 | 0 | 5.51 KB |
| master | StartStopWithChild |
netcoreapp3.1 | 13.5μs | 45.3ns | 163ns | 0 | 0 | 0 | 5.57 KB |
| master | StartStopWithChild |
net472 | 22.5μs | 108ns | 447ns | 0.992 | 0.441 | 0.11 | 5.94 KB |
| #7827 | StartStopWithChild |
net6.0 | 10.7μs | 27.8ns | 96.4ns | 0 | 0 | 0 | 5.51 KB |
| #7827 | StartStopWithChild |
netcoreapp3.1 | 13.7μs | 71.1ns | 341ns | 0 | 0 | 0 | 5.71 KB |
| #7827 | StartStopWithChild |
net472 | 22.7μs | 105ns | 408ns | 0.896 | 0.336 | 0 | 6.03 KB |
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7827
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472
3.26 KB
3.44 KB
174 B
5.33%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 | 3.26 KB | 3.44 KB | 174 B | 5.33% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 1.28ms | 208ns | 807ns | 0 | 0 | 0 | 2.7 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.43ms | 693ns | 2.68μs | 0 | 0 | 0 | 2.71 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 1.7ms | 206ns | 771ns | 0 | 0 | 0 | 3.26 KB |
| #7827 | WriteAndFlushEnrichedTraces |
net6.0 | 1.28ms | 127ns | 492ns | 0 | 0 | 0 | 2.7 KB |
| #7827 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.38ms | 129ns | 483ns | 0 | 0 | 0 | 2.7 KB |
| #7827 | WriteAndFlushEnrichedTraces |
net472 | 1.81ms | 1.49μs | 5.76μs | 0 | 0 | 0 | 3.44 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.55ns | 2.06ns | 0 | 0 | 0 | 1.22 KB |
| master | AllCycleSimpleBody |
netcoreapp3.1 | 1.41μs | 1.15ns | 4.44ns | 0 | 0 | 0 | 1.2 KB |
| master | AllCycleSimpleBody |
net472 | 1.01μs | 0.479ns | 1.86ns | 0.192 | 0 | 0 | 1.23 KB |
| master | AllCycleMoreComplexBody |
net6.0 | 7.24μs | 6.84ns | 26.5ns | 0 | 0 | 0 | 4.72 KB |
| master | AllCycleMoreComplexBody |
netcoreapp3.1 | 9.18μs | 45.1ns | 191ns | 0 | 0 | 0 | 4.62 KB |
| master | AllCycleMoreComplexBody |
net472 | 7.69μs | 3.53ns | 13.7ns | 0.729 | 0 | 0 | 4.74 KB |
| master | ObjectExtractorSimpleBody |
net6.0 | 340ns | 1.65ns | 6.81ns | 0 | 0 | 0 | 280 B |
| master | ObjectExtractorSimpleBody |
netcoreapp3.1 | 395ns | 2.18ns | 12.4ns | 0 | 0 | 0 | 272 B |
| master | ObjectExtractorSimpleBody |
net472 | 295ns | 0.0129ns | 0.05ns | 0.0445 | 0 | 0 | 281 B |
| master | ObjectExtractorMoreComplexBody |
net6.0 | 6.3μs | 30.8ns | 134ns | 0 | 0 | 0 | 3.78 KB |
| master | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.9μs | 36.9ns | 148ns | 0 | 0 | 0 | 3.69 KB |
| master | ObjectExtractorMoreComplexBody |
net472 | 6.67μs | 1.38ns | 5.15ns | 0.601 | 0 | 0 | 3.8 KB |
| #7827 | AllCycleSimpleBody |
net6.0 | 1.08μs | 6.2ns | 51.1ns | 0 | 0 | 0 | 1.22 KB |
| #7827 | AllCycleSimpleBody |
netcoreapp3.1 | 1.38μs | 7.94ns | 61.5ns | 0 | 0 | 0 | 1.2 KB |
| #7827 | AllCycleSimpleBody |
net472 | 989ns | 0.406ns | 1.52ns | 0.193 | 0 | 0 | 1.23 KB |
| #7827 | AllCycleMoreComplexBody |
net6.0 | 7.09μs | 38.5ns | 214ns | 0 | 0 | 0 | 4.72 KB |
| #7827 | AllCycleMoreComplexBody |
netcoreapp3.1 | 8.9μs | 47ns | 253ns | 0 | 0 | 0 | 4.62 KB |
| #7827 | AllCycleMoreComplexBody |
net472 | 7.71μs | 3.34ns | 12.9ns | 0.732 | 0 | 0 | 4.74 KB |
| #7827 | ObjectExtractorSimpleBody |
net6.0 | 330ns | 0.138ns | 0.533ns | 0 | 0 | 0 | 280 B |
| #7827 | ObjectExtractorSimpleBody |
netcoreapp3.1 | 405ns | 2.11ns | 10.5ns | 0 | 0 | 0 | 272 B |
| #7827 | ObjectExtractorSimpleBody |
net472 | 304ns | 0.0131ns | 0.0489ns | 0.0443 | 0 | 0 | 281 B |
| #7827 | ObjectExtractorMoreComplexBody |
net6.0 | 6.32μs | 4.16ns | 15.6ns | 0 | 0 | 0 | 3.78 KB |
| #7827 | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.98μs | 41.9ns | 209ns | 0 | 0 | 0 | 3.69 KB |
| #7827 | ObjectExtractorMoreComplexBody |
net472 | 6.72μs | 2.27ns | 8.79ns | 0.573 | 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 | 77.9μs | 182ns | 706ns | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
netcoreapp3.1 | 99.1μs | 23.8ns | 92.2ns | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
net472 | 109μs | 11.8ns | 45.9ns | 4.89 | 0 | 0 | 32.5 KB |
| master | EncodeLegacyArgs |
net6.0 | 146μs | 10.8ns | 41.7ns | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
netcoreapp3.1 | 198μs | 32.5ns | 126ns | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
net472 | 262μs | 25.1ns | 97.4ns | 0 | 0 | 0 | 2.14 KB |
| #7827 | EncodeArgs |
net6.0 | 75.9μs | 219ns | 847ns | 0 | 0 | 0 | 32.4 KB |
| #7827 | EncodeArgs |
netcoreapp3.1 | 97.9μs | 216ns | 837ns | 0 | 0 | 0 | 32.4 KB |
| #7827 | EncodeArgs |
net472 | 110μs | 62.3ns | 241ns | 4.95 | 0 | 0 | 32.5 KB |
| #7827 | EncodeLegacyArgs |
net6.0 | 144μs | 9.09ns | 35.2ns | 0 | 0 | 0 | 2.14 KB |
| #7827 | EncodeLegacyArgs |
netcoreapp3.1 | 200μs | 62.9ns | 235ns | 0 | 0 | 0 | 2.14 KB |
| #7827 | EncodeLegacyArgs |
net472 | 264μs | 18.4ns | 68.7ns | 0 | 0 | 0 | 2.14 KB |
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunWafRealisticBenchmark |
net6.0 | 439μs | 1.9μs | 6.85μs | 0 | 0 | 0 | 4.55 KB |
| master | RunWafRealisticBenchmark |
netcoreapp3.1 | 473μs | 3.2μs | 30μs | 0 | 0 | 0 | 4.48 KB |
| master | RunWafRealisticBenchmark |
net472 | 497μs | 660ns | 2.47μs | 0 | 0 | 0 | 0 b |
| master | RunWafRealisticBenchmarkWithAttack |
net6.0 | 312μs | 1.46μs | 5.46μs | 0 | 0 | 0 | 2.24 KB |
| master | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 354μs | 2.91μs | 27.8μs | 0 | 0 | 0 | 2.22 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net472 | 369μs | 199ns | 718ns | 0 | 0 | 0 | 0 b |
| #7827 | RunWafRealisticBenchmark |
net6.0 | 420μs | 545ns | 1.89μs | 0 | 0 | 0 | 4.55 KB |
| #7827 | RunWafRealisticBenchmark |
netcoreapp3.1 | 447μs | 1.66μs | 5.76μs | 0 | 0 | 0 | 4.48 KB |
| #7827 | RunWafRealisticBenchmark |
net472 | 497μs | 305ns | 1.06μs | 0 | 0 | 0 | 0 b |
| #7827 | RunWafRealisticBenchmarkWithAttack |
net6.0 | 309μs | 590ns | 2.13μs | 0 | 0 | 0 | 2.24 KB |
| #7827 | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 356μs | 2.9μs | 28.1μs | 0 | 0 | 0 | 2.22 KB |
| #7827 | RunWafRealisticBenchmarkWithAttack |
net472 | 373μs | 115ns | 416ns | 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 | 86.5μs | 456ns | 2.37μs | 0 | 0 | 0 | 18.97 KB |
| master | SendRequest |
netcoreapp3.1 | 97.4μs | 245ns | 1.37μs | 0 | 0 | 0 | 21.18 KB |
| master | SendRequest |
net472 | 0ns | 0ns | 0ns | 0 | 0 | 0 | 0 b |
| #7827 | SendRequest |
net6.0 | 85.2μs | 241ns | 900ns | 0 | 0 | 0 | 18.97 KB |
| #7827 | SendRequest |
netcoreapp3.1 | 97.5μs | 451ns | 2.99μs | 0 | 0 | 0 | 21.18 KB |
| #7827 | SendRequest |
net472 | 0ns | 0ns | 0ns | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | OriginalCharSlice |
net6.0 | 1.91ms | 2.12μs | 8.22μs | 0 | 0 | 0 | 640 KB |
| master | OriginalCharSlice |
netcoreapp3.1 | 4.2ms | 2.19μs | 8.46μs | 0 | 0 | 0 | 640.05 KB |
| master | OriginalCharSlice |
net472 | 2.57ms | 390ns | 1.41μs | 0 | 0 | 0 | 638.98 KB |
| master | OptimizedCharSlice |
net6.0 | 1.44ms | 1.05μs | 4.06μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSlice |
netcoreapp3.1 | 2.81ms | 791ns | 2.85μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSlice |
net472 | 2.15ms | 694ns | 2.5μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net6.0 | 1.01ms | 1.23μs | 4.76μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
netcoreapp3.1 | 1.86ms | 1.63μs | 6.31μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net472 | 1.17ms | 940ns | 3.64μs | 0 | 0 | 0 | 0 b |
| #7827 | OriginalCharSlice |
net6.0 | 1.97ms | 1.33μs | 4.8μs | 0 | 0 | 0 | 640 KB |
| #7827 | OriginalCharSlice |
netcoreapp3.1 | 3.87ms | 1.84μs | 7.13μs | 0 | 0 | 0 | 640.05 KB |
| #7827 | OriginalCharSlice |
net472 | 2.61ms | 570ns | 2.13μs | 0 | 0 | 0 | 638.98 KB |
| #7827 | OptimizedCharSlice |
net6.0 | 1.51ms | 536ns | 2.01μs | 0 | 0 | 0 | 0 b |
| #7827 | OptimizedCharSlice |
netcoreapp3.1 | 2.77ms | 591ns | 2.21μs | 0 | 0 | 0 | 0 b |
| #7827 | OptimizedCharSlice |
net472 | 2ms | 944ns | 3.4μs | 0 | 0 | 0 | 0 b |
| #7827 | OptimizedCharSliceWithPool |
net6.0 | 1.01ms | 735ns | 2.85μs | 0 | 0 | 0 | 0 b |
| #7827 | OptimizedCharSliceWithPool |
netcoreapp3.1 | 1.89ms | 2.38μs | 9.21μs | 0 | 0 | 0 | 0 b |
| #7827 | OptimizedCharSliceWithPool |
net472 | 1.16ms | 488ns | 1.83μs | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7827
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0
41.73 KB
42.59 KB
865 B
2.07%
Fewer allocations 🎉 in #7827
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1
42.1 KB
41.83 KB
-264 B
-0.63%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 | 41.73 KB | 42.59 KB | 865 B | 2.07% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 42.1 KB | 41.83 KB | -264 B | -0.63% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 658μs | 2.16μs | 16.4μs | 0 | 0 | 0 | 41.73 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 778μs | 4.14μs | 21.5μs | 0 | 0 | 0 | 42.1 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 971μs | 4.77μs | 20.2μs | 4.81 | 0 | 0 | 56.04 KB |
| #7827 | WriteAndFlushEnrichedTraces |
net6.0 | 700μs | 3.69μs | 18.1μs | 0 | 0 | 0 | 42.59 KB |
| #7827 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 756μs | 4.24μs | 30μs | 0 | 0 | 0 | 41.83 KB |
| #7827 | WriteAndFlushEnrichedTraces |
net472 | 947μs | 4.56μs | 17.7μs | 4.81 | 0 | 0 | 55.89 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.9μs | 7.2ns | 27.9ns | 0 | 0 | 0 | 968 B |
| master | ExecuteNonQuery |
netcoreapp3.1 | 2.48μs | 3.49ns | 13ns | 0 | 0 | 0 | 960 B |
| master | ExecuteNonQuery |
net472 | 2.92μs | 2.32ns | 8.68ns | 0.144 | 0 | 0 | 931 B |
| #7827 | ExecuteNonQuery |
net6.0 | 1.88μs | 9.21ns | 38ns | 0 | 0 | 0 | 968 B |
| #7827 | ExecuteNonQuery |
netcoreapp3.1 | 2.56μs | 7.93ns | 30.7ns | 0 | 0 | 0 | 960 B |
| #7827 | ExecuteNonQuery |
net472 | 2.8μs | 2.5ns | 9.36ns | 0.141 | 0 | 0 | 931 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.76μs | 6.41ns | 24.8ns | 0 | 0 | 0 | 952 B |
| master | CallElasticsearch |
netcoreapp3.1 | 2.29μs | 4.79ns | 18.5ns | 0 | 0 | 0 | 968 B |
| master | CallElasticsearch |
net472 | 3.32μs | 5.15ns | 20ns | 0.15 | 0 | 0 | 955 B |
| master | CallElasticsearchAsync |
net6.0 | 1.89μs | 9.5ns | 40.3ns | 0 | 0 | 0 | 928 B |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 2.44μs | 7.62ns | 29.5ns | 0 | 0 | 0 | 1.02 KB |
| master | CallElasticsearchAsync |
net472 | 3.69μs | 2.19ns | 8.49ns | 0.146 | 0 | 0 | 1.01 KB |
| #7827 | CallElasticsearch |
net6.0 | 1.68μs | 8.5ns | 36.1ns | 0 | 0 | 0 | 952 B |
| #7827 | CallElasticsearch |
netcoreapp3.1 | 2.37μs | 1.91ns | 7.41ns | 0 | 0 | 0 | 968 B |
| #7827 | CallElasticsearch |
net472 | 3.39μs | 6.42ns | 24.9ns | 0.135 | 0 | 0 | 955 B |
| #7827 | CallElasticsearchAsync |
net6.0 | 1.7μs | 8.66ns | 39.7ns | 0 | 0 | 0 | 928 B |
| #7827 | CallElasticsearchAsync |
netcoreapp3.1 | 2.35μs | 11.7ns | 52.5ns | 0 | 0 | 0 | 1.02 KB |
| #7827 | CallElasticsearchAsync |
net472 | 3.49μs | 3.53ns | 13.7ns | 0.157 | 0 | 0 | 1.01 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.89μs | 1.1ns | 4.25ns | 0 | 0 | 0 | 896 B |
| master | ExecuteAsync |
netcoreapp3.1 | 2.42μs | 6.21ns | 24ns | 0 | 0 | 0 | 896 B |
| master | ExecuteAsync |
net472 | 2.55μs | 2.84ns | 11ns | 0.126 | 0 | 0 | 859 B |
| #7827 | ExecuteAsync |
net6.0 | 1.91μs | 7.71ns | 28.8ns | 0 | 0 | 0 | 896 B |
| #7827 | ExecuteAsync |
netcoreapp3.1 | 2.32μs | 4.58ns | 17.7ns | 0 | 0 | 0 | 896 B |
| #7827 | ExecuteAsync |
net472 | 2.58μs | 1.15ns | 4ns | 0.129 | 0 | 0 | 858 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 | 7.04μs | 28.5ns | 110ns | 0 | 0 | 0 | 2.29 KB |
| master | SendAsync |
netcoreapp3.1 | 8.29μs | 31.9ns | 124ns | 0 | 0 | 0 | 2.83 KB |
| master | SendAsync |
net472 | 12μs | 4.52ns | 17.5ns | 0.481 | 0 | 0 | 3.08 KB |
| #7827 | SendAsync |
net6.0 | 7.01μs | 25.2ns | 94.2ns | 0 | 0 | 0 | 2.29 KB |
| #7827 | SendAsync |
netcoreapp3.1 | 8.43μs | 15.1ns | 58.6ns | 0 | 0 | 0 | 2.83 KB |
| #7827 | SendAsync |
net472 | 11.8μs | 5.96ns | 23.1ns | 0.47 | 0 | 0 | 3.08 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7827
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1
257.02 KB
272.94 KB
15.91 KB
6.19%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0
257.62 KB
272.86 KB
15.24 KB
5.92%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 | 257.02 KB | 272.94 KB | 15.91 KB | 6.19% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 257.62 KB | 272.86 KB | 15.24 KB | 5.92% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StringConcatBenchmark |
net6.0 | 45.3μs | 254ns | 2.21μs | 0 | 0 | 0 | 42.51 KB |
| master | StringConcatBenchmark |
netcoreapp3.1 | 49.9μs | 203ns | 950ns | 0 | 0 | 0 | 42.54 KB |
| master | StringConcatBenchmark |
net472 | 56.8μs | 266ns | 1.03μs | 0 | 0 | 0 | 49.15 KB |
| master | StringConcatAspectBenchmark |
net6.0 | 444μs | 1.39μs | 6.06μs | 0 | 0 | 0 | 257.62 KB |
| master | StringConcatAspectBenchmark |
netcoreapp3.1 | 485μs | 1.23μs | 5.36μs | 0 | 0 | 0 | 257.02 KB |
| master | StringConcatAspectBenchmark |
net472 | 406μs | 2.01μs | 8.98μs | 0 | 0 | 0 | 270.34 KB |
| #7827 | StringConcatBenchmark |
net6.0 | 45.1μs | 233ns | 1.09μs | 0 | 0 | 0 | 42.51 KB |
| #7827 | StringConcatBenchmark |
netcoreapp3.1 | 50.7μs | 294ns | 2.35μs | 0 | 0 | 0 | 42.54 KB |
| #7827 | StringConcatBenchmark |
net472 | 56.3μs | 285ns | 1.21μs | 0 | 0 | 0 | 49.15 KB |
| #7827 | StringConcatAspectBenchmark |
net6.0 | 476μs | 1.73μs | 7.15μs | 0 | 0 | 0 | 272.86 KB |
| #7827 | StringConcatAspectBenchmark |
netcoreapp3.1 | 520μs | 2.44μs | 9.12μs | 0 | 0 | 0 | 272.94 KB |
| #7827 | StringConcatAspectBenchmark |
net472 | 403μs | 1.99μs | 9.1μs | 0 | 0 | 0 | 270.34 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.66μs | 0.531ns | 2.06ns | 0 | 0 | 0 | 1.69 KB |
| master | EnrichedLog |
netcoreapp3.1 | 3.58μs | 12.8ns | 49.6ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
net472 | 3.72μs | 7.02ns | 27.2ns | 0.241 | 0 | 0 | 1.6 KB |
| #7827 | EnrichedLog |
net6.0 | 2.66μs | 6.23ns | 24.1ns | 0 | 0 | 0 | 1.69 KB |
| #7827 | EnrichedLog |
netcoreapp3.1 | 3.52μs | 12.1ns | 46.7ns | 0 | 0 | 0 | 1.7 KB |
| #7827 | EnrichedLog |
net472 | 3.95μs | 4.4ns | 17ns | 0.254 | 0 | 0 | 1.6 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 | 123μs | 89.8ns | 348ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
netcoreapp3.1 | 128μs | 153ns | 572ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
net472 | 168μs | 270ns | 1.05μs | 0 | 0 | 0 | 4.51 KB |
| #7827 | EnrichedLog |
net6.0 | 124μs | 86.8ns | 325ns | 0 | 0 | 0 | 4.31 KB |
| #7827 | EnrichedLog |
netcoreapp3.1 | 128μs | 164ns | 634ns | 0 | 0 | 0 | 4.31 KB |
| #7827 | EnrichedLog |
net472 | 167μs | 200ns | 774ns | 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 | 5.06μs | 17.1ns | 66.4ns | 0 | 0 | 0 | 2.24 KB |
| master | EnrichedLog |
netcoreapp3.1 | 6.93μs | 20.2ns | 78.1ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
net472 | 7.75μs | 10ns | 38.8ns | 0.312 | 0 | 0 | 2.05 KB |
| #7827 | EnrichedLog |
net6.0 | 5.27μs | 3.55ns | 13.7ns | 0 | 0 | 0 | 2.24 KB |
| #7827 | EnrichedLog |
netcoreapp3.1 | 6.85μs | 16.8ns | 60.5ns | 0 | 0 | 0 | 2.26 KB |
| #7827 | EnrichedLog |
net472 | 7.6μs | 7.11ns | 27.6ns | 0.304 | 0 | 0 | 2.05 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.93μs | 6.93ns | 25ns | 0 | 0 | 0 | 1.12 KB |
| master | SendReceive |
netcoreapp3.1 | 2.71μs | 11.8ns | 45.8ns | 0 | 0 | 0 | 1.14 KB |
| master | SendReceive |
net472 | 2.86μs | 11.1ns | 43.2ns | 0.173 | 0 | 0 | 1.12 KB |
| #7827 | SendReceive |
net6.0 | 1.92μs | 9.09ns | 35.2ns | 0 | 0 | 0 | 1.12 KB |
| #7827 | SendReceive |
netcoreapp3.1 | 2.42μs | 12ns | 53.8ns | 0 | 0 | 0 | 1.14 KB |
| #7827 | SendReceive |
net472 | 2.81μs | 2.68ns | 9.65ns | 0.169 | 0 | 0 | 1.12 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.44μs | 12.2ns | 47.4ns | 0 | 0 | 0 | 1.58 KB |
| master | EnrichedLog |
netcoreapp3.1 | 5.54μs | 11.6ns | 44.8ns | 0 | 0 | 0 | 1.63 KB |
| master | EnrichedLog |
net472 | 7.15μs | 8.45ns | 32.7ns | 0.319 | 0 | 0 | 2.03 KB |
| #7827 | EnrichedLog |
net6.0 | 4.3μs | 15.9ns | 59.5ns | 0 | 0 | 0 | 1.58 KB |
| #7827 | EnrichedLog |
netcoreapp3.1 | 5.79μs | 19.4ns | 75.1ns | 0 | 0 | 0 | 1.63 KB |
| #7827 | EnrichedLog |
net472 | 6.53μs | 11.7ns | 45.4ns | 0.293 | 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 | 779ns | 2.45ns | 9.5ns | 0 | 0 | 0 | 520 B |
| master | StartFinishSpan |
netcoreapp3.1 | 961ns | 4.97ns | 24.8ns | 0 | 0 | 0 | 520 B |
| master | StartFinishSpan |
net472 | 887ns | 0.0294ns | 0.106ns | 0.0801 | 0 | 0 | 522 B |
| master | StartFinishScope |
net6.0 | 908ns | 4.36ns | 18.5ns | 0 | 0 | 0 | 640 B |
| master | StartFinishScope |
netcoreapp3.1 | 1.15μs | 4.75ns | 18.4ns | 0 | 0 | 0 | 640 B |
| master | StartFinishScope |
net472 | 1.1μs | 0.263ns | 0.91ns | 0.0935 | 0 | 0 | 602 B |
| master | StartFinishTwoScopes |
net6.0 | 1.81μs | 4.71ns | 18.2ns | 0 | 0 | 0 | 1.19 KB |
| master | StartFinishTwoScopes |
netcoreapp3.1 | 2.22μs | 9.17ns | 35.5ns | 0 | 0 | 0 | 1.19 KB |
| master | StartFinishTwoScopes |
net472 | 2.13μs | 0.621ns | 2.32ns | 0.171 | 0 | 0 | 1.08 KB |
| #7827 | StartFinishSpan |
net6.0 | 766ns | 3.79ns | 15.6ns | 0 | 0 | 0 | 520 B |
| #7827 | StartFinishSpan |
netcoreapp3.1 | 978ns | 4.63ns | 17.3ns | 0 | 0 | 0 | 520 B |
| #7827 | StartFinishSpan |
net472 | 896ns | 0.111ns | 0.401ns | 0.0808 | 0 | 0 | 522 B |
| #7827 | StartFinishScope |
net6.0 | 933ns | 4.63ns | 21.7ns | 0 | 0 | 0 | 640 B |
| #7827 | StartFinishScope |
netcoreapp3.1 | 1.15μs | 5ns | 19.4ns | 0 | 0 | 0 | 640 B |
| #7827 | StartFinishScope |
net472 | 1.11μs | 0.391ns | 1.52ns | 0.0949 | 0 | 0 | 602 B |
| #7827 | StartFinishTwoScopes |
net6.0 | 1.77μs | 9.58ns | 53.3ns | 0 | 0 | 0 | 1.19 KB |
| #7827 | StartFinishTwoScopes |
netcoreapp3.1 | 2.21μs | 11.5ns | 53.7ns | 0 | 0 | 0 | 1.19 KB |
| #7827 | StartFinishTwoScopes |
net472 | 2.18μs | 1.63ns | 6.3ns | 0.164 | 0 | 0 | 1.08 KB |
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 | 4.85ns | 19.4ns | 0 | 0 | 0 | 640 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 1.39μs | 6.44ns | 25.8ns | 0 | 0 | 0 | 640 B |
| master | RunOnMethodBegin |
net472 | 1.43μs | 0.673ns | 2.61ns | 0.0933 | 0 | 0 | 602 B |
| #7827 | RunOnMethodBegin |
net6.0 | 1.1μs | 0.629ns | 2.35ns | 0 | 0 | 0 | 640 B |
| #7827 | RunOnMethodBegin |
netcoreapp3.1 | 1.4μs | 5.76ns | 22.3ns | 0 | 0 | 0 | 640 B |
| #7827 | RunOnMethodBegin |
net472 | 1.43μs | 0.188ns | 0.679ns | 0.0934 | 0 | 0 | 602 B |
This reverts commit 2fa26ce.
This reverts commit b47f447.
tracer/src/Datadog.Trace/DataStreamsMonitoring/DataStreamsWriter.cs
Outdated
Show resolved
Hide resolved
andrewlock
left a comment
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.
I like the separation of the two jobs, but unfortunately I think we're going to need to rewrite the async timer part 🙁
tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml
Outdated
Show resolved
Hide resolved
tracer/src/Datadog.Trace/DataStreamsMonitoring/DataStreamsWriter.cs
Outdated
Show resolved
Hide resolved
andrewlock
left a comment
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.
LGTM, thanks!
Summary of changes
Moves DSM flush work to a dedicated thread to improve thread pool performance. Also simplifies the flushing logic to more closely match the AgentWriter logic.
(See below for test results)
Reason for change
A = DSM enabled after the fix

B = DSM enabled before the fix
DSM flush logic was previously running entirely on the thread pool, which includes the task to frequently move DSM checkpoints off of the buffer and add them to the backlog. This was causing thread contention shown in the above profile.
Implementation details
Moves the DSM buffer flushing logic into it's own thread. Below is a profile after the fix (DSM disabled on the right).
Test coverage
Mostly manual testing. I ran a set of three apps:
The test app just forwards a Kafka message every 0.5 seconds.
And run those via docker-compose with a restricted CPU count of 0.1 and 0.5 in the below screenshots. In both cases, DSM disabled is the lowest CPU usage, and the line just above is DSM enabled after the fix. The highest CPU is DSM enabled, prior to the fix. The performance is a lot better, but I'm not sure if the gap can be closed further.
Other details