Fix null character termination in CString abstraction.#7785
Conversation
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7785) 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 (7785) - mean (74ms) : 69, 79
master - mean (75ms) : 68, 82
section Bailout
This PR (7785) - mean (78ms) : 72, 85
master - mean (79ms) : 74, 84
section CallTarget+Inlining+NGEN
This PR (7785) - mean (1,106ms) : 1028, 1183
master - mean (1,097ms) : 1039, 1155
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 (7785) - mean (117ms) : 110, 124
master - mean (118ms) : 110, 126
section Bailout
This PR (7785) - mean (119ms) : 109, 129
master - mean (118ms) : 113, 124
section CallTarget+Inlining+NGEN
This PR (7785) - mean (798ms) : 760, 835
master - mean (805ms) : 777, 834
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7785) - mean (104ms) : 95, 112
master - mean (104ms) : 98, 109
section Bailout
This PR (7785) - mean (104ms) : 97, 111
master - mean (105ms) : 99, 111
section CallTarget+Inlining+NGEN
This PR (7785) - mean (748ms) : 716, 780
master - mean (759ms) : 726, 792
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7785) - mean (102ms) : 94, 110
master - mean (103ms) : 95, 111
section Bailout
This PR (7785) - mean (102ms) : 95, 109
master - mean (103ms) : 98, 109
section CallTarget+Inlining+NGEN
This PR (7785) - mean (698ms) : 669, 728
master - mean (719ms) : 694, 744
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 (7785) - mean (192ms) : 189, 196
master - mean (191ms) : 188, 195
section Bailout
This PR (7785) - mean (196ms) : 193, 198
master - mean (195ms) : 191, 198
section CallTarget+Inlining+NGEN
This PR (7785) - mean (1,170ms) : 1098, 1242
master - mean (1,166ms) : 1090, 1241
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 (7785) - mean (276ms) : 271, 280
master - mean (275ms) : 269, 281
section Bailout
This PR (7785) - mean (275ms) : 272, 278
master - mean (275ms) : 271, 280
section CallTarget+Inlining+NGEN
This PR (7785) - mean (940ms) : 898, 981
master - mean (943ms) : 904, 981
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7785) - mean (269ms) : 263, 275
master - mean (267ms) : 261, 273
section Bailout
This PR (7785) - mean (268ms) : 265, 271
master - mean (269ms) : 262, 276
section CallTarget+Inlining+NGEN
This PR (7785) - mean (929ms) : 878, 981
master - mean (925ms) : 878, 973
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7785) - mean (268ms) : 264, 272
master - mean (267ms) : 261, 272
section Bailout
This PR (7785) - mean (269ms) : 264, 273
master - mean (268ms) : 260, 275
section CallTarget+Inlining+NGEN
This PR (7785) - mean (848ms) : 830, 867
master - mean (849ms) : 822, 877
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dfdf56a to
bea2d9e
Compare
BenchmarksBenchmarks Report for benchmark platform 🐌Benchmarks for #7785 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.69 KB | 5.73 KB | 40 B | 0.70% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 | 6.11 KB | 6.04 KB | -70 B | -1.14% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartStopWithChild |
net6.0 | 11.1μs | 56.6ns | 271ns | 0 | 0 | 0 | 5.51 KB |
| master | StartStopWithChild |
netcoreapp3.1 | 13.6μs | 68.9ns | 308ns | 0 | 0 | 0 | 5.69 KB |
| master | StartStopWithChild |
net472 | 22.7μs | 130ns | 964ns | 0.957 | 0.319 | 0 | 6.11 KB |
| #7785 | StartStopWithChild |
net6.0 | 10.5μs | 58.8ns | 381ns | 0 | 0 | 0 | 5.51 KB |
| #7785 | StartStopWithChild |
netcoreapp3.1 | 13.8μs | 62.3ns | 241ns | 0 | 0 | 0 | 5.73 KB |
| #7785 | StartStopWithChild |
net472 | 22.1μs | 121ns | 715ns | 1.06 | 0.318 | 0.106 | 6.04 KB |
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7785
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472
3.31 KB
3.35 KB
46 B
1.39%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 | 3.31 KB | 3.35 KB | 46 B | 1.39% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 935μs | 171ns | 618ns | 0 | 0 | 0 | 2.71 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.03ms | 158ns | 590ns | 0 | 0 | 0 | 2.7 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 1.2ms | 710ns | 2.75μs | 0 | 0 | 0 | 3.31 KB |
| #7785 | WriteAndFlushEnrichedTraces |
net6.0 | 940μs | 104ns | 373ns | 0 | 0 | 0 | 2.71 KB |
| #7785 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.02ms | 387ns | 1.34μs | 0 | 0 | 0 | 2.7 KB |
| #7785 | WriteAndFlushEnrichedTraces |
net472 | 1.2ms | 707ns | 2.74μs | 0 | 0 | 0 | 3.35 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.08μs | 5.78ns | 32.2ns | 0 | 0 | 0 | 1.22 KB |
| master | AllCycleSimpleBody |
netcoreapp3.1 | 1.38μs | 7.59ns | 48ns | 0 | 0 | 0 | 1.2 KB |
| master | AllCycleSimpleBody |
net472 | 1.05μs | 0.957ns | 3.58ns | 0.194 | 0 | 0 | 1.23 KB |
| master | AllCycleMoreComplexBody |
net6.0 | 6.98μs | 34.6ns | 158ns | 0 | 0 | 0 | 4.72 KB |
| master | AllCycleMoreComplexBody |
netcoreapp3.1 | 8.98μs | 44.5ns | 199ns | 0 | 0 | 0 | 4.62 KB |
| master | AllCycleMoreComplexBody |
net472 | 7.58μs | 4.88ns | 18.9ns | 0.718 | 0 | 0 | 4.74 KB |
| master | ObjectExtractorSimpleBody |
net6.0 | 318ns | 1.66ns | 7.6ns | 0 | 0 | 0 | 280 B |
| master | ObjectExtractorSimpleBody |
netcoreapp3.1 | 403ns | 2.15ns | 11.2ns | 0 | 0 | 0 | 272 B |
| master | ObjectExtractorSimpleBody |
net472 | 297ns | 0.025ns | 0.097ns | 0.0434 | 0 | 0 | 281 B |
| master | ObjectExtractorMoreComplexBody |
net6.0 | 6.28μs | 29.4ns | 114ns | 0 | 0 | 0 | 3.78 KB |
| master | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.89μs | 30.3ns | 113ns | 0 | 0 | 0 | 3.69 KB |
| master | ObjectExtractorMoreComplexBody |
net472 | 6.7μs | 3.66ns | 14.2ns | 0.57 | 0 | 0 | 3.8 KB |
| #7785 | AllCycleSimpleBody |
net6.0 | 1.06μs | 6.21ns | 61.1ns | 0 | 0 | 0 | 1.22 KB |
| #7785 | AllCycleSimpleBody |
netcoreapp3.1 | 1.42μs | 7.42ns | 37.8ns | 0 | 0 | 0 | 1.2 KB |
| #7785 | AllCycleSimpleBody |
net472 | 1.03μs | 0.353ns | 1.37ns | 0.191 | 0 | 0 | 1.23 KB |
| #7785 | AllCycleMoreComplexBody |
net6.0 | 6.98μs | 37.2ns | 193ns | 0 | 0 | 0 | 4.72 KB |
| #7785 | AllCycleMoreComplexBody |
netcoreapp3.1 | 9.08μs | 35.3ns | 137ns | 0 | 0 | 0 | 4.62 KB |
| #7785 | AllCycleMoreComplexBody |
net472 | 7.64μs | 2.13ns | 8.24ns | 0.725 | 0 | 0 | 4.74 KB |
| #7785 | ObjectExtractorSimpleBody |
net6.0 | 319ns | 1.77ns | 10.9ns | 0 | 0 | 0 | 280 B |
| #7785 | ObjectExtractorSimpleBody |
netcoreapp3.1 | 405ns | 2.06ns | 10.3ns | 0 | 0 | 0 | 272 B |
| #7785 | ObjectExtractorSimpleBody |
net472 | 306ns | 0.0888ns | 0.344ns | 0.0446 | 0 | 0 | 281 B |
| #7785 | ObjectExtractorMoreComplexBody |
net6.0 | 6.33μs | 32.3ns | 152ns | 0 | 0 | 0 | 3.79 KB |
| #7785 | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.7μs | 39.4ns | 185ns | 0 | 0 | 0 | 3.69 KB |
| #7785 | ObjectExtractorMoreComplexBody |
net472 | 6.7μs | 3.83ns | 14.8ns | 0.57 | 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.2μs | 296ns | 1.15μs | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
netcoreapp3.1 | 99.5μs | 429ns | 1.66μs | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
net472 | 110μs | 17.8ns | 68.8ns | 4.93 | 0 | 0 | 32.51 KB |
| master | EncodeLegacyArgs |
net6.0 | 143μs | 171ns | 663ns | 0 | 0 | 0 | 2.15 KB |
| master | EncodeLegacyArgs |
netcoreapp3.1 | 198μs | 156ns | 606ns | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
net472 | 263μs | 121ns | 470ns | 0 | 0 | 0 | 2.16 KB |
| #7785 | EncodeArgs |
net6.0 | 76.4μs | 263ns | 984ns | 0 | 0 | 0 | 32.4 KB |
| #7785 | EncodeArgs |
netcoreapp3.1 | 98μs | 281ns | 1.09μs | 0 | 0 | 0 | 32.4 KB |
| #7785 | EncodeArgs |
net472 | 110μs | 12.9ns | 49.8ns | 4.93 | 0 | 0 | 32.5 KB |
| #7785 | EncodeLegacyArgs |
net6.0 | 145μs | 27.5ns | 107ns | 0 | 0 | 0 | 2.15 KB |
| #7785 | EncodeLegacyArgs |
netcoreapp3.1 | 197μs | 244ns | 944ns | 0 | 0 | 0 | 2.14 KB |
| #7785 | EncodeLegacyArgs |
net472 | 265μs | 22.2ns | 86ns | 0 | 0 | 0 | 2.16 KB |
Benchmarks.Trace.Asm.AppSecWafBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #7785
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1
2.438
304,112.20
741,467.00
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1
2.039
423,307.54
862,977.92
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1 | 2.438 | 304,112.20 | 741,467.00 | |
| Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1 | 2.039 | 423,307.54 | 862,977.92 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunWafRealisticBenchmark |
net6.0 | 393μs | 123ns | 476ns | 0 | 0 | 0 | 4.55 KB |
| master | RunWafRealisticBenchmark |
netcoreapp3.1 | 424μs | 398ns | 1.54μs | 0 | 0 | 0 | 4.48 KB |
| master | RunWafRealisticBenchmark |
net472 | 430μs | 53.6ns | 208ns | 0 | 0 | 0 | 4.66 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net6.0 | 283μs | 60.7ns | 235ns | 0 | 0 | 0 | 2.24 KB |
| master | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 304μs | 73ns | 283ns | 0 | 0 | 0 | 2.22 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net472 | 309μs | 71.6ns | 277ns | 0 | 0 | 0 | 2.29 KB |
| #7785 | RunWafRealisticBenchmark |
net6.0 | 398μs | 148ns | 572ns | 0 | 0 | 0 | 4.56 KB |
| #7785 | RunWafRealisticBenchmark |
netcoreapp3.1 | 822μs | 13μs | 130μs | 0 | 0 | 0 | 4.48 KB |
| #7785 | RunWafRealisticBenchmark |
net472 | 432μs | 49ns | 190ns | 0 | 0 | 0 | 4.66 KB |
| #7785 | RunWafRealisticBenchmarkWithAttack |
net6.0 | 287μs | 37.9ns | 131ns | 0 | 0 | 0 | 2.24 KB |
| #7785 | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 721μs | 9.11μs | 89.2μs | 0 | 0 | 0 | 2.22 KB |
| #7785 | RunWafRealisticBenchmarkWithAttack |
net472 | 310μs | 39.9ns | 155ns | 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.9μs | 102ns | 381ns | 0 | 0 | 0 | 14.52 KB |
| master | SendRequest |
netcoreapp3.1 | 70.8μs | 137ns | 493ns | 0 | 0 | 0 | 17.42 KB |
| master | SendRequest |
net472 | 0.00303ns | 0.00128ns | 0.00495ns | 0 | 0 | 0 | 0 b |
| #7785 | SendRequest |
net6.0 | 60.7μs | 50.7ns | 196ns | 0 | 0 | 0 | 14.52 KB |
| #7785 | SendRequest |
netcoreapp3.1 | 72.5μs | 76.2ns | 295ns | 0 | 0 | 0 | 17.42 KB |
| #7785 | SendRequest |
net472 | 0.00104ns | 0.00104ns | 0.00402ns | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CharSliceBenchmark - Faster 🎉 More allocations ⚠️
Faster 🎉 in #7785
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0
1.122
900,653.12
803,011.33
More allocations ⚠️ in #7785
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net472
0 b
73 B
73 B
∞
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472
0 b
47 B
47 B
∞
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0
4 B
7 B
3 B
75.00%
Fewer allocations 🎉 in #7785
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0
3 B
2 B
-1 B
-33.33%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1
1 B
0 b
-1 B
-100.00%
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 | 1.122 | 900,653.12 | 803,011.33 |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net472 | 0 b | 73 B | 73 B | ∞ |
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472 | 0 b | 47 B | 47 B | ∞ |
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 | 4 B | 7 B | 3 B | 75.00% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 | 3 B | 2 B | -1 B | -33.33% |
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1 | 1 B | 0 b | -1 B | -100.00% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | OriginalCharSlice |
net6.0 | 1.93ms | 1.87μs | 7.24μs | 0 | 0 | 0 | 640.01 KB |
| master | OriginalCharSlice |
netcoreapp3.1 | 2.12ms | 1.16μs | 4.19μs | 0 | 0 | 0 | 640 KB |
| master | OriginalCharSlice |
net472 | 2.65ms | 170ns | 660ns | 100 | 0 | 0 | 641.95 KB |
| master | OptimizedCharSlice |
net6.0 | 1.37ms | 69.3ns | 259ns | 0 | 0 | 0 | 4 B |
| master | OptimizedCharSlice |
netcoreapp3.1 | 1.7ms | 2.5μs | 9.7μs | 0 | 0 | 0 | 1 B |
| master | OptimizedCharSlice |
net472 | 2.02ms | 245ns | 949ns | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net6.0 | 901μs | 24.6ns | 91.9ns | 0 | 0 | 0 | 3 B |
| master | OptimizedCharSliceWithPool |
netcoreapp3.1 | 821μs | 117ns | 453ns | 0 | 0 | 0 | 1 B |
| master | OptimizedCharSliceWithPool |
net472 | 1.13ms | 74.6ns | 289ns | 0 | 0 | 0 | 0 b |
| #7785 | OriginalCharSlice |
net6.0 | 1.93ms | 4.86μs | 18.2μs | 0 | 0 | 0 | 640.01 KB |
| #7785 | OriginalCharSlice |
netcoreapp3.1 | 2.13ms | 7.31μs | 27.3μs | 0 | 0 | 0 | 640 KB |
| #7785 | OriginalCharSlice |
net472 | 2.59ms | 1.63μs | 6.3μs | 100 | 0 | 0 | 641.95 KB |
| #7785 | OptimizedCharSlice |
net6.0 | 1.42ms | 127ns | 491ns | 0 | 0 | 0 | 7 B |
| #7785 | OptimizedCharSlice |
netcoreapp3.1 | 1.66ms | 562ns | 2.18μs | 0 | 0 | 0 | 1 B |
| #7785 | OptimizedCharSlice |
net472 | 2.04ms | 291ns | 1.13μs | 0 | 0 | 0 | 73 B |
| #7785 | OptimizedCharSliceWithPool |
net6.0 | 803μs | 75.1ns | 291ns | 0 | 0 | 0 | 2 B |
| #7785 | OptimizedCharSliceWithPool |
netcoreapp3.1 | 827μs | 72.5ns | 281ns | 0 | 0 | 0 | 0 b |
| #7785 | OptimizedCharSliceWithPool |
net472 | 1.13ms | 62ns | 240ns | 0 | 0 | 0 | 47 B |
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Slower ⚠️ Fewer allocations 🎉
Slower ⚠️ in #7785
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1
1.172
686,040.14
804,371.53
Fewer allocations 🎉 in #7785
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472
56.49 KB
56.05 KB
-443 B
-0.78%
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 1.172 | 686,040.14 | 804,371.53 |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 | 56.49 KB | 56.05 KB | -443 B | -0.78% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 654μs | 3.22μs | 14.4μs | 0 | 0 | 0 | 41.71 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 686μs | 864ns | 3.23μs | 0 | 0 | 0 | 41.88 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 936μs | 3.51μs | 13.6μs | 8.33 | 0 | 0 | 56.49 KB |
| #7785 | WriteAndFlushEnrichedTraces |
net6.0 | 735μs | 1.69μs | 6.09μs | 0 | 0 | 0 | 41.85 KB |
| #7785 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 794μs | 4.45μs | 28.5μs | 0 | 0 | 0 | 41.73 KB |
| #7785 | WriteAndFlushEnrichedTraces |
net472 | 858μs | 3μs | 10.8μs | 8.33 | 0 | 0 | 56.05 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.97μs | 2.57ns | 9.95ns | 0 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
netcoreapp3.1 | 2.66μs | 3.75ns | 14.5ns | 0 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
net472 | 2.91μs | 5.2ns | 20.2ns | 0.146 | 0.0146 | 0 | 987 B |
| #7785 | ExecuteNonQuery |
net6.0 | 1.87μs | 9.35ns | 42.9ns | 0 | 0 | 0 | 1.02 KB |
| #7785 | ExecuteNonQuery |
netcoreapp3.1 | 2.64μs | 12.5ns | 48.3ns | 0 | 0 | 0 | 1.02 KB |
| #7785 | ExecuteNonQuery |
net472 | 2.9μs | 3.48ns | 13.5ns | 0.145 | 0.0145 | 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.66μs | 8.52ns | 40ns | 0 | 0 | 0 | 1.03 KB |
| master | CallElasticsearch |
netcoreapp3.1 | 2.21μs | 9.87ns | 38.2ns | 0 | 0 | 0 | 1.03 KB |
| master | CallElasticsearch |
net472 | 3.61μs | 3.37ns | 12.6ns | 0.163 | 0 | 0 | 1.04 KB |
| master | CallElasticsearchAsync |
net6.0 | 1.93μs | 4.94ns | 19.1ns | 0 | 0 | 0 | 1.01 KB |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 2.39μs | 10.8ns | 41.8ns | 0 | 0 | 0 | 1.08 KB |
| master | CallElasticsearchAsync |
net472 | 3.71μs | 6.48ns | 25.1ns | 0.165 | 0 | 0 | 1.1 KB |
| #7785 | CallElasticsearch |
net6.0 | 1.72μs | 6.9ns | 26.7ns | 0 | 0 | 0 | 1.03 KB |
| #7785 | CallElasticsearch |
netcoreapp3.1 | 2.26μs | 6.3ns | 24.4ns | 0 | 0 | 0 | 1.03 KB |
| #7785 | CallElasticsearch |
net472 | 3.79μs | 0.886ns | 3.43ns | 0.152 | 0 | 0 | 1.04 KB |
| #7785 | CallElasticsearchAsync |
net6.0 | 1.87μs | 7.36ns | 28.5ns | 0 | 0 | 0 | 1.01 KB |
| #7785 | CallElasticsearchAsync |
netcoreapp3.1 | 2.38μs | 8.91ns | 34.5ns | 0 | 0 | 0 | 1.08 KB |
| #7785 | CallElasticsearchAsync |
net472 | 3.75μs | 5.66ns | 21.9ns | 0.168 | 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.91μs | 7.12ns | 27.6ns | 0 | 0 | 0 | 952 B |
| master | ExecuteAsync |
netcoreapp3.1 | 2.37μs | 9.45ns | 35.4ns | 0 | 0 | 0 | 952 B |
| master | ExecuteAsync |
net472 | 2.54μs | 0.933ns | 3.61ns | 0.139 | 0 | 0 | 915 B |
| #7785 | ExecuteAsync |
net6.0 | 1.91μs | 3.27ns | 12.7ns | 0 | 0 | 0 | 952 B |
| #7785 | ExecuteAsync |
netcoreapp3.1 | 2.53μs | 2.95ns | 11.4ns | 0 | 0 | 0 | 952 B |
| #7785 | ExecuteAsync |
net472 | 2.52μs | 1.17ns | 4.05ns | 0.138 | 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 | 7.14μs | 5.72ns | 22.1ns | 0 | 0 | 0 | 2.36 KB |
| master | SendAsync |
netcoreapp3.1 | 8.43μs | 15.9ns | 61.4ns | 0 | 0 | 0 | 2.9 KB |
| master | SendAsync |
net472 | 12.3μs | 10.2ns | 38.3ns | 0.492 | 0 | 0 | 3.18 KB |
| #7785 | SendAsync |
net6.0 | 6.54μs | 25.4ns | 98.5ns | 0 | 0 | 0 | 2.36 KB |
| #7785 | SendAsync |
netcoreapp3.1 | 8.66μs | 26.2ns | 101ns | 0 | 0 | 0 | 2.9 KB |
| #7785 | SendAsync |
net472 | 12.4μs | 5.74ns | 20.7ns | 0.496 | 0 | 0 | 3.18 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7785
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1
258.63 KB
274.08 KB
15.45 KB
5.97%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0
256.22 KB
257.82 KB
1.61 KB
0.63%
Fewer allocations 🎉 in #7785
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0
44.39 KB
43.44 KB
-952 B
-2.14%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 | 258.63 KB | 274.08 KB | 15.45 KB | 5.97% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 256.22 KB | 257.82 KB | 1.61 KB | 0.63% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 | 44.39 KB | 43.44 KB | -952 B | -2.14% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StringConcatBenchmark |
net6.0 | 49.4μs | 779ns | 7.72μs | 0 | 0 | 0 | 44.39 KB |
| master | StringConcatBenchmark |
netcoreapp3.1 | 49.5μs | 271ns | 2.16μs | 0 | 0 | 0 | 42.83 KB |
| master | StringConcatBenchmark |
net472 | 57μs | 100ns | 348ns | 0 | 0 | 0 | 65.54 KB |
| master | StringConcatAspectBenchmark |
net6.0 | 435μs | 1.38μs | 4.78μs | 0 | 0 | 0 | 256.22 KB |
| master | StringConcatAspectBenchmark |
netcoreapp3.1 | 507μs | 1.02μs | 4.43μs | 0 | 0 | 0 | 258.63 KB |
| master | StringConcatAspectBenchmark |
net472 | 400μs | 1.84μs | 7.12μs | 0 | 0 | 0 | 286.72 KB |
| #7785 | StringConcatBenchmark |
net6.0 | 44.8μs | 215ns | 858ns | 0 | 0 | 0 | 43.44 KB |
| #7785 | StringConcatBenchmark |
netcoreapp3.1 | 51μs | 434ns | 4.09μs | 0 | 0 | 0 | 42.86 KB |
| #7785 | StringConcatBenchmark |
net472 | 57.8μs | 253ns | 981ns | 0 | 0 | 0 | 65.54 KB |
| #7785 | StringConcatAspectBenchmark |
net6.0 | 460μs | 1.98μs | 7.14μs | 0 | 0 | 0 | 257.82 KB |
| #7785 | StringConcatAspectBenchmark |
netcoreapp3.1 | 515μs | 2.53μs | 10.7μs | 0 | 0 | 0 | 274.08 KB |
| #7785 | StringConcatAspectBenchmark |
net472 | 399μs | 630ns | 2.27μs | 0 | 0 | 0 | 286.72 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.58μs | 11.9ns | 47.6ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
netcoreapp3.1 | 3.61μs | 17.4ns | 75.9ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
net472 | 3.98μs | 4.88ns | 18.9ns | 0.258 | 0 | 0 | 1.64 KB |
| #7785 | EnrichedLog |
net6.0 | 2.7μs | 2.41ns | 9.33ns | 0 | 0 | 0 | 1.7 KB |
| #7785 | EnrichedLog |
netcoreapp3.1 | 3.59μs | 2.37ns | 9.18ns | 0 | 0 | 0 | 1.7 KB |
| #7785 | EnrichedLog |
net472 | 4.01μs | 5.74ns | 22.2ns | 0.241 | 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 | 123μs | 334ns | 1.29μs | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
netcoreapp3.1 | 128μs | 275ns | 990ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
net472 | 173μs | 395ns | 1.53μs | 0 | 0 | 0 | 4.52 KB |
| #7785 | EnrichedLog |
net6.0 | 124μs | 642ns | 3.01μs | 0 | 0 | 0 | 4.31 KB |
| #7785 | EnrichedLog |
netcoreapp3.1 | 126μs | 79.9ns | 288ns | 0 | 0 | 0 | 4.31 KB |
| #7785 | EnrichedLog |
net472 | 168μs | 122ns | 472ns | 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 | 5.3μs | 18ns | 69.5ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
netcoreapp3.1 | 6.74μs | 25.4ns | 98.2ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
net472 | 7.57μs | 6.16ns | 23.9ns | 0.302 | 0 | 0 | 2.08 KB |
| #7785 | EnrichedLog |
net6.0 | 5.13μs | 13ns | 44.9ns | 0 | 0 | 0 | 2.26 KB |
| #7785 | EnrichedLog |
netcoreapp3.1 | 6.8μs | 9.51ns | 36.9ns | 0 | 0 | 0 | 2.26 KB |
| #7785 | EnrichedLog |
net472 | 7.64μs | 8.06ns | 31.2ns | 0.304 | 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 | 9.27ns | 35.9ns | 0 | 0 | 0 | 1.2 KB |
| master | SendReceive |
netcoreapp3.1 | 2.65μs | 11.5ns | 44.6ns | 0 | 0 | 0 | 1.2 KB |
| master | SendReceive |
net472 | 3.1μs | 1.85ns | 7.16ns | 0.184 | 0 | 0 | 1.2 KB |
| #7785 | SendReceive |
net6.0 | 1.94μs | 10.2ns | 50.9ns | 0 | 0 | 0 | 1.2 KB |
| #7785 | SendReceive |
netcoreapp3.1 | 2.64μs | 6.12ns | 22.9ns | 0 | 0 | 0 | 1.2 KB |
| #7785 | SendReceive |
net472 | 3.05μs | 2.04ns | 7.89ns | 0.184 | 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.35μs | 7.54ns | 29.2ns | 0 | 0 | 0 | 1.58 KB |
| master | EnrichedLog |
netcoreapp3.1 | 5.65μs | 4.4ns | 15.9ns | 0 | 0 | 0 | 1.63 KB |
| master | EnrichedLog |
net472 | 6.56μs | 5.41ns | 21ns | 0.296 | 0 | 0 | 2.03 KB |
| #7785 | EnrichedLog |
net6.0 | 4.38μs | 7.4ns | 28.7ns | 0 | 0 | 0 | 1.58 KB |
| #7785 | EnrichedLog |
netcoreapp3.1 | 5.68μs | 12.9ns | 49.9ns | 0 | 0 | 0 | 1.63 KB |
| #7785 | EnrichedLog |
net472 | 6.66μs | 14.1ns | 54.7ns | 0.298 | 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 | 783ns | 0.292ns | 1.09ns | 0 | 0 | 0 | 576 B |
| master | StartFinishSpan |
netcoreapp3.1 | 961ns | 5.18ns | 29.3ns | 0 | 0 | 0 | 576 B |
| master | StartFinishSpan |
net472 | 933ns | 1.11ns | 4.29ns | 0.0893 | 0 | 0 | 578 B |
| master | StartFinishScope |
net6.0 | 904ns | 4.81ns | 25.5ns | 0 | 0 | 0 | 696 B |
| master | StartFinishScope |
netcoreapp3.1 | 1.21μs | 5.35ns | 20.7ns | 0 | 0 | 0 | 696 B |
| master | StartFinishScope |
net472 | 1.12μs | 0.561ns | 2.17ns | 0.102 | 0 | 0 | 658 B |
| #7785 | StartFinishSpan |
net6.0 | 774ns | 0.165ns | 0.639ns | 0 | 0 | 0 | 576 B |
| #7785 | StartFinishSpan |
netcoreapp3.1 | 951ns | 4.76ns | 22.3ns | 0 | 0 | 0 | 576 B |
| #7785 | StartFinishSpan |
net472 | 931ns | 0.675ns | 2.53ns | 0.0884 | 0 | 0 | 578 B |
| #7785 | StartFinishScope |
net6.0 | 916ns | 5.13ns | 34ns | 0 | 0 | 0 | 696 B |
| #7785 | StartFinishScope |
netcoreapp3.1 | 1.2μs | 6.36ns | 32.4ns | 0 | 0 | 0 | 696 B |
| #7785 | StartFinishScope |
net472 | 1.22μs | 0.453ns | 1.75ns | 0.103 | 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.06μs | 5.51ns | 28.1ns | 0 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 1.46μs | 3.1ns | 12ns | 0 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
net472 | 1.46μs | 1.29ns | 4.82ns | 0.103 | 0 | 0 | 658 B |
| #7785 | RunOnMethodBegin |
net6.0 | 1.06μs | 0.43ns | 1.61ns | 0 | 0 | 0 | 696 B |
| #7785 | RunOnMethodBegin |
netcoreapp3.1 | 1.42μs | 0.432ns | 1.67ns | 0 | 0 | 0 | 696 B |
| #7785 | RunOnMethodBegin |
net472 | 1.49μs | 1.04ns | 3.91ns | 0.103 | 0 | 0 | 658 B |
Summary of changes
Add null termination byte for CString abstraction.
Reason for change
Testing the new libdatadog release I noticed some errors when Cstrings were passed to the process discovery native API.
Implementation details
Make extra space for null character and add the termination character at the end of the buffer.
Test coverage
🙈
Other details