Skip to content

Conversation

@gleocadie
Copy link
Collaborator

@gleocadie gleocadie commented Sep 25, 2025

Summary of changes

Bump to libdatadog v23.

Reason for change

This version provides fixes for crashtracker.

Implementation details

Update vcpkg and cmake files.

Test coverage

Other details

https://datadoghq.atlassian.net/browse/PROF-12961

@github-actions github-actions bot added the area:profiler Issues related to the continous-profiler label Sep 25, 2025
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Sep 25, 2025

⚠️ Tests

⚠️ Warnings

🧪 1 Test failed

CheckGitMetataFromEnvironmentVariables from Datadog.Profiler.IntegrationTests.DebugInfo.GitMetadataTest (Datadog)
The test Samples.BuggyBits is running for too long or was lost

ℹ️ Info

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: c457900 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@dd-trace-dotnet-ci-bot
Copy link

dd-trace-dotnet-ci-bot bot commented Sep 25, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7560) and master.

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration76.40 ± (76.37 - 77.07) ms74.97 ± (74.90 - 75.56) ms-1.9%
.NET Framework 4.8 - Bailout
duration79.65 ± (79.47 - 80.17) ms78.88 ± (78.85 - 79.40) ms-1.0%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1060.16 ± (1064.96 - 1076.92) ms1051.22 ± (1055.80 - 1067.47) ms-0.8%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.84 ± (22.76 - 22.91) ms22.85 ± (22.78 - 22.92) ms+0.1%✅⬆️
process.time_to_main_ms86.82 ± (86.40 - 87.23) ms87.52 ± (87.15 - 87.89) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.93 ± (10.93 - 10.94) MB10.94 ± (10.94 - 10.94) MB+0.1%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.71 ± (22.65 - 22.78) ms22.82 ± (22.74 - 22.89) ms+0.4%✅⬆️
process.time_to_main_ms88.82 ± (88.52 - 89.13) ms89.87 ± (89.49 - 90.26) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.97 ± (10.97 - 10.98) MB10.98 ± (10.98 - 10.98) MB+0.1%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms220.09 ± (218.72 - 221.46) ms219.62 ± (218.19 - 221.05) ms-0.2%
process.time_to_main_ms497.23 ± (496.18 - 498.29) ms495.23 ± (494.16 - 496.30) ms-0.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed47.82 ± (47.80 - 47.84) MB47.82 ± (47.80 - 47.84) MB+0.0%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.4%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms21.69 ± (21.63 - 21.76) ms21.98 ± (21.91 - 22.04) ms+1.3%✅⬆️
process.time_to_main_ms76.74 ± (76.38 - 77.10) ms77.01 ± (76.71 - 77.32) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.62 ± (10.62 - 10.62) MB10.66 ± (10.66 - 10.66) MB+0.4%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.61 ± (21.54 - 21.68) ms21.80 ± (21.72 - 21.87) ms+0.8%✅⬆️
process.time_to_main_ms76.89 ± (76.60 - 77.17) ms77.72 ± (77.36 - 78.08) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.66 ± (10.66 - 10.66) MB10.69 ± (10.69 - 10.70) MB+0.3%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms214.76 ± (212.38 - 217.14) ms209.69 ± (208.40 - 210.98) ms-2.4%
process.time_to_main_ms464.64 ± (463.64 - 465.64) ms465.99 ± (464.97 - 467.02) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.00 ± (47.98 - 48.02) MB48.12 ± (48.09 - 48.15) MB+0.3%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.80 ± (19.73 - 19.86) ms19.96 ± (19.90 - 20.02) ms+0.8%✅⬆️
process.time_to_main_ms74.91 ± (74.59 - 75.24) ms75.72 ± (75.38 - 76.06) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.70 ± (7.69 - 7.70) MB7.69 ± (7.68 - 7.70) MB-0.1%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.79 ± (19.73 - 19.84) ms19.81 ± (19.74 - 19.87) ms+0.1%✅⬆️
process.time_to_main_ms76.10 ± (75.76 - 76.44) ms76.11 ± (75.82 - 76.40) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.74 ± (7.74 - 7.74) MB7.74 ± (7.74 - 7.75) MB+0.0%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms191.15 ± (190.26 - 192.04) ms191.89 ± (190.90 - 192.89) ms+0.4%✅⬆️
process.time_to_main_ms453.57 ± (452.54 - 454.61) ms454.85 ± (454.01 - 455.69) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.35 ± (36.31 - 36.39) MB36.49 ± (36.45 - 36.53) MB+0.4%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.1%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration192.06 ± (192.04 - 192.74) ms192.91 ± (192.87 - 193.70) ms+0.4%✅⬆️
.NET Framework 4.8 - Bailout
duration196.15 ± (196.06 - 196.76) ms196.49 ± (196.27 - 196.88) ms+0.2%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1109.82 ± (1115.10 - 1126.54) ms1099.82 ± (1104.36 - 1113.56) ms-0.9%
.NET Core 3.1 - Baseline
process.internal_duration_ms188.06 ± (187.69 - 188.42) ms187.95 ± (187.56 - 188.34) ms-0.1%
process.time_to_main_ms80.30 ± (80.13 - 80.46) ms80.53 ± (80.30 - 80.76) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.06 ± (16.04 - 16.09) MB16.10 ± (16.07 - 16.13) MB+0.2%✅⬆️
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (19 - 20)-0.1%
.NET Core 3.1 - Bailout
process.internal_duration_ms187.07 ± (186.81 - 187.32) ms186.88 ± (186.63 - 187.13) ms-0.1%
process.time_to_main_ms81.57 ± (81.43 - 81.71) ms81.71 ± (81.60 - 81.81) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.15 ± (16.12 - 16.18) MB16.17 ± (16.14 - 16.20) MB+0.1%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms401.94 ± (398.86 - 405.02) ms405.27 ± (402.11 - 408.43) ms+0.8%✅⬆️
process.time_to_main_ms471.83 ± (471.09 - 472.58) ms472.26 ± (471.59 - 472.92) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.35 ± (58.20 - 58.50) MB58.48 ± (58.35 - 58.61) MB+0.2%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms191.52 ± (191.23 - 191.82) ms192.37 ± (192.01 - 192.74) ms+0.4%✅⬆️
process.time_to_main_ms69.87 ± (69.71 - 70.03) ms69.77 ± (69.62 - 69.92) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.24 ± (16.12 - 16.35) MB16.16 ± (16.02 - 16.30) MB-0.5%
runtime.dotnet.threads.count18 ± (18 - 19)18 ± (18 - 18)-0.9%
.NET 6 - Bailout
process.internal_duration_ms191.37 ± (191.01 - 191.72) ms191.56 ± (191.13 - 191.99) ms+0.1%✅⬆️
process.time_to_main_ms70.60 ± (70.51 - 70.70) ms70.93 ± (70.79 - 71.07) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.42 ± (16.34 - 16.50) MB16.18 ± (16.06 - 16.31) MB-1.4%
runtime.dotnet.threads.count20 ± (20 - 20)19 ± (19 - 19)-3.1%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms413.04 ± (409.96 - 416.11) ms416.82 ± (413.67 - 419.97) ms+0.9%✅⬆️
process.time_to_main_ms440.87 ± (440.25 - 441.48) ms439.98 ± (439.35 - 440.62) ms-0.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed58.61 ± (58.46 - 58.77) MB58.86 ± (58.73 - 58.99) MB+0.4%✅⬆️
runtime.dotnet.threads.count30 ± (29 - 30)30 ± (29 - 30)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms190.74 ± (190.30 - 191.18) ms190.10 ± (189.79 - 190.41) ms-0.3%
process.time_to_main_ms69.59 ± (69.40 - 69.78) ms69.27 ± (69.09 - 69.45) ms-0.5%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.69 ± (11.67 - 11.72) MB11.71 ± (11.68 - 11.74) MB+0.1%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.2%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms189.83 ± (189.51 - 190.15) ms189.73 ± (189.46 - 190.01) ms-0.0%
process.time_to_main_ms70.30 ± (70.18 - 70.42) ms70.18 ± (70.08 - 70.27) ms-0.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.84 ± (11.80 - 11.87) MB11.75 ± (11.73 - 11.78) MB-0.7%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.5%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms365.44 ± (363.86 - 367.03) ms364.51 ± (362.84 - 366.17) ms-0.3%
process.time_to_main_ms428.69 ± (428.20 - 429.17) ms428.08 ± (427.51 - 428.66) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed47.81 ± (47.78 - 47.84) MB47.78 ± (47.75 - 47.82) MB-0.0%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.0%
Comparison explanation

Execution-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:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

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 charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7560) - mean (75ms)  : 70, 80
    master - mean (77ms)  : 72, 82

    section Bailout
    This PR (7560) - mean (79ms)  : 75, 83
    master - mean (80ms)  : 75, 85

    section CallTarget+Inlining+NGEN
    This PR (7560) - mean (1,062ms)  : 974, 1149
    master - mean (1,071ms)  : 982, 1159

Loading
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 (7560) - mean (118ms)  : 110, 125
    master - mean (117ms)  : 110, 125

    section Bailout
    This PR (7560) - mean (121ms)  : 114, 127
    master - mean (119ms)  : 113, 125

    section CallTarget+Inlining+NGEN
    This PR (7560) - mean (758ms)  : 719, 796
    master - mean (761ms)  : 712, 811

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7560) - mean (106ms)  : 100, 112
    master - mean (105ms)  : 100, 111

    section Bailout
    This PR (7560) - mean (107ms)  : 100, 114
    master - mean (105ms)  : 100, 111

    section CallTarget+Inlining+NGEN
    This PR (7560) - mean (713ms)  : 676, 749
    master - mean (710ms)  : 660, 759

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7560) - mean (104ms)  : 98, 111
    master - mean (103ms)  : 97, 110

    section Bailout
    This PR (7560) - mean (105ms)  : 97, 112
    master - mean (105ms)  : 97, 112

    section CallTarget+Inlining+NGEN
    This PR (7560) - mean (689ms)  : 665, 713
    master - mean (684ms)  : 654, 713

Loading
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 (7560) - mean (193ms)  : 189, 198
    master - mean (192ms)  : 189, 196

    section Bailout
    This PR (7560) - mean (197ms)  : 194, 200
    master - mean (196ms)  : 193, 200

    section CallTarget+Inlining+NGEN
    This PR (7560) - mean (1,109ms)  : 1044, 1174
    master - mean (1,121ms)  : 1031, 1211

Loading
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 (7560) - mean (277ms)  : 270, 283
    master - mean (277ms)  : 271, 283

    section Bailout
    This PR (7560) - mean (277ms)  : 274, 280
    master - mean (277ms)  : 274, 280

    section CallTarget+Inlining+NGEN
    This PR (7560) - mean (910ms)  : 853, 967
    master - mean (904ms)  : 855, 953

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7560) - mean (270ms)  : 265, 275
    master - mean (270ms)  : 266, 274

    section Bailout
    This PR (7560) - mean (271ms)  : 265, 276
    master - mean (270ms)  : 266, 274

    section CallTarget+Inlining+NGEN
    This PR (7560) - mean (885ms)  : 834, 937
    master - mean (887ms)  : 833, 941

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7560) - mean (269ms)  : 264, 273
    master - mean (270ms)  : 263, 276

    section Bailout
    This PR (7560) - mean (269ms)  : 266, 273
    master - mean (270ms)  : 265, 274

    section CallTarget+Inlining+NGEN
    This PR (7560) - mean (822ms)  : 803, 841
    master - mean (825ms)  : 805, 845

Loading

@gleocadie gleocadie force-pushed the gleocadie/bump-to-libdatadog-21 branch 2 times, most recently from 0e74d35 to e7e8a6c Compare October 2, 2025 07:50
@gleocadie gleocadie force-pushed the gleocadie/bump-to-libdatadog-21 branch from e7e8a6c to cd0cf78 Compare October 3, 2025 07:38
@dmehala
Copy link

dmehala commented Oct 3, 2025

Hey @gleocadie
libdatadog v22.0.0 introduces a breaking change in the process discovery FFI. In case you are facing a compilation issue regarding this API, I have a draft that should solve this issue: #7607

Please let me know if I can help.

@gleocadie gleocadie force-pushed the gleocadie/bump-to-libdatadog-21 branch 2 times, most recently from cadf784 to 74a70a6 Compare October 6, 2025 08:53
@gleocadie
Copy link
Collaborator Author

Hey @gleocadie libdatadog v22.0.0 introduces a breaking change in the process discovery FFI. In case you are facing a compilation issue regarding this API, I have a draft that should solve this issue: #7607

Please let me know if I can help.

Hey, sorry I missed your message @dmehala
I'll use your fixes in my PR and see how it goes
Thanks

@gleocadie gleocadie force-pushed the gleocadie/bump-to-libdatadog-21 branch 7 times, most recently from 2a06b13 to cca2898 Compare October 6, 2025 12:36
@pr-commenter
Copy link

pr-commenter bot commented Oct 17, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7560 compared to master:

  • 4 benchmarks are faster, with geometric mean 1.622
  • 3 benchmarks have fewer allocations
  • 9 benchmarks have more allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7560

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.1 KB 6.02 KB -77 B -1.26%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.7μs 53.2ns 219ns 0 0 0 5.51 KB
master StartStopWithChild netcoreapp3.1 13.9μs 59.4ns 230ns 0 0 0 5.7 KB
master StartStopWithChild net472 22.5μs 119ns 653ns 0.963 0.214 0 6.1 KB
#7560 StartStopWithChild net6.0 10.6μs 57.6ns 310ns 0 0 0 5.5 KB
#7560 StartStopWithChild netcoreapp3.1 13.4μs 72.2ns 375ns 0 0 0 5.71 KB
#7560 StartStopWithChild net472 21.7μs 104ns 452ns 1.02 0.338 0.113 6.02 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7560

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 934μs 170ns 659ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.04ms 280ns 1.09μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.19ms 240ns 928ns 0 0 0 3.31 KB
#7560 WriteAndFlushEnrichedTraces net6.0 939μs 152ns 549ns 0 0 0 2.71 KB
#7560 WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 1.15μs 4.45μs 0 0 0 2.7 KB
#7560 WriteAndFlushEnrichedTraces net472 1.22ms 994ns 3.85μ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.06μs 6ns 34ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.44μs 0.837ns 3.24ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.02μs 0.193ns 0.722ns 0.193 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 7.21μs 35.8ns 160ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 9μs 36.7ns 137ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.69μs 5.41ns 20.9ns 0.731 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 319ns 1.72ns 9.7ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 385ns 2.18ns 14.1ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 297ns 0.0397ns 0.148ns 0.0439 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.28μs 31.9ns 153ns 0 0 0 3.79 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.83μs 2.59ns 9.67ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.69μs 4.12ns 16ns 0.601 0 0 3.8 KB
#7560 AllCycleSimpleBody net6.0 1.05μs 5.98ns 45.5ns 0 0 0 1.22 KB
#7560 AllCycleSimpleBody netcoreapp3.1 1.39μs 0.357ns 1.33ns 0 0 0 1.2 KB
#7560 AllCycleSimpleBody net472 1.04μs 1.54ns 5.96ns 0.193 0 0 1.23 KB
#7560 AllCycleMoreComplexBody net6.0 7.06μs 35.9ns 172ns 0 0 0 4.72 KB
#7560 AllCycleMoreComplexBody netcoreapp3.1 8.92μs 43.2ns 178ns 0 0 0 4.62 KB
#7560 AllCycleMoreComplexBody net472 7.66μs 4.14ns 16ns 0.725 0 0 4.74 KB
#7560 ObjectExtractorSimpleBody net6.0 323ns 1.79ns 11.1ns 0 0 0 280 B
#7560 ObjectExtractorSimpleBody netcoreapp3.1 408ns 2.11ns 10.1ns 0 0 0 272 B
#7560 ObjectExtractorSimpleBody net472 302ns 0.0609ns 0.236ns 0.0441 0 0 281 B
#7560 ObjectExtractorMoreComplexBody net6.0 6.29μs 3.46ns 13.4ns 0 0 0 3.78 KB
#7560 ObjectExtractorMoreComplexBody netcoreapp3.1 7.86μs 30.5ns 114ns 0 0 0 3.69 KB
#7560 ObjectExtractorMoreComplexBody net472 6.73μs 3.57ns 13.8ns 0.571 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.8μs 186ns 695ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 96.8μs 296ns 1.15μs 0 0 0 32.4 KB
master EncodeArgs net472 109μs 7.23ns 27.1ns 4.91 0 0 32.51 KB
master EncodeLegacyArgs net6.0 148μs 56.9ns 213ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 199μs 141ns 527ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 264μs 19.6ns 70.7ns 0 0 0 2.16 KB
#7560 EncodeArgs net6.0 77.5μs 135ns 521ns 0 0 0 32.4 KB
#7560 EncodeArgs netcoreapp3.1 97.7μs 170ns 612ns 0 0 0 32.4 KB
#7560 EncodeArgs net472 109μs 7.59ns 28.4ns 4.92 0 0 32.51 KB
#7560 EncodeLegacyArgs net6.0 146μs 201ns 779ns 0 0 0 2.15 KB
#7560 EncodeLegacyArgs netcoreapp3.1 199μs 613ns 2.37μs 0 0 0 2.14 KB
#7560 EncodeLegacyArgs net472 266μs 353ns 1.37μs 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #7560

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1 2.422 720,470.98 297,513.15
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1 2.084 853,429.64 409,573.69

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 396μs 119ns 460ns 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 809μs 13.4μs 134μs 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 430μs 84.7ns 328ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 289μs 22.3ns 83.3ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 671μs 13.5μs 134μs 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 310μs 37.6ns 146ns 0 0 0 2.29 KB
#7560 RunWafRealisticBenchmark net6.0 401μs 206ns 800ns 0 0 0 4.55 KB
#7560 RunWafRealisticBenchmark netcoreapp3.1 409μs 347ns 1.34μs 0 0 0 4.49 KB
#7560 RunWafRealisticBenchmark net472 431μs 43.7ns 164ns 0 0 0 4.66 KB
#7560 RunWafRealisticBenchmarkWithAttack net6.0 293μs 58.4ns 211ns 0 0 0 2.24 KB
#7560 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 297μs 163ns 611ns 0 0 0 2.22 KB
#7560 RunWafRealisticBenchmarkWithAttack net472 316μs 24ns 93.1ns 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.3μs 41.5ns 161ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 71.6μs 63.2ns 245ns 0 0 0 17.42 KB
master SendRequest net472 0.00307ns 0.00157ns 0.00609ns 0 0 0 0 b
#7560 SendRequest net6.0 61.4μs 267ns 963ns 0 0 0 14.52 KB
#7560 SendRequest netcoreapp3.1 71.8μs 335ns 1.95μs 0 0 0 17.42 KB
#7560 SendRequest net472 0.00657ns 0.00199ns 0.00771ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7560

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 2 B 4 B 2 B 100.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 7 B 8 B 1 B 14.29%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.91ms 532ns 1.99μs 0 0 0 640.01 KB
master OriginalCharSlice netcoreapp3.1 2.14ms 7.49μs 29μs 0 0 0 640 KB
master OriginalCharSlice net472 2.62ms 881ns 3.41μs 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.35ms 2.73μs 10.6μs 0 0 0 7 B
master OptimizedCharSlice netcoreapp3.1 1.69ms 297ns 1.15μs 0 0 0 1 B
master OptimizedCharSlice net472 1.94ms 170ns 638ns 0 0 0 0 b
master OptimizedCharSliceWithPool net6.0 816μs 26.3ns 102ns 0 0 0 2 B
master OptimizedCharSliceWithPool netcoreapp3.1 873μs 52.2ns 195ns 0 0 0 1 B
master OptimizedCharSliceWithPool net472 1.14ms 113ns 439ns 0 0 0 0 b
#7560 OriginalCharSlice net6.0 1.93ms 669ns 2.41μs 0 0 0 640.01 KB
#7560 OriginalCharSlice netcoreapp3.1 2.11ms 7.04μs 26.4μs 0 0 0 640 KB
#7560 OriginalCharSlice net472 2.65ms 90.9ns 328ns 100 0 0 641.95 KB
#7560 OptimizedCharSlice net6.0 1.5ms 248ns 959ns 0 0 0 8 B
#7560 OptimizedCharSlice netcoreapp3.1 1.68ms 508ns 1.97μs 0 0 0 1 B
#7560 OptimizedCharSlice net472 1.88ms 1.28μs 4.78μs 0 0 0 0 b
#7560 OptimizedCharSliceWithPool net6.0 817μs 44.5ns 172ns 0 0 0 4 B
#7560 OptimizedCharSliceWithPool netcoreapp3.1 832μs 37.5ns 135ns 0 0 0 1 B
#7560 OptimizedCharSliceWithPool net472 1.15ms 152ns 589ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Faster 🎉 More allocations ⚠️

Faster 🎉 in #7560

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 1.229 1,028,238.54 836,735.42
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 1.117 744,565.44 666,724.55

More allocations ⚠️ in #7560

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 41.78 KB 42.41 KB 625 B 1.50%
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 55.94 KB 56.39 KB 453 B 0.81%

Fewer allocations 🎉 in #7560

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 42.75 KB 41.88 KB -872 B -2.04%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 719μs 937ns 3.51μs 0 0 0 41.78 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 748μs 2.2μs 8.54μs 0 0 0 42.75 KB
master WriteAndFlushEnrichedTraces net472 1.03ms 5.08μs 21.6μs 5.21 0 0 55.94 KB
#7560 WriteAndFlushEnrichedTraces net6.0 711μs 2.97μs 11.5μs 0 0 0 42.41 KB
#7560 WriteAndFlushEnrichedTraces netcoreapp3.1 662μs 2.77μs 10.3μs 0 0 0 41.88 KB
#7560 WriteAndFlushEnrichedTraces net472 840μs 2.71μs 10.5μs 8.33 0 0 56.39 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 9.71ns 47.6ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.62μs 9.75ns 37.8ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.86μs 3.4ns 13.2ns 0.156 0.0142 0 987 B
#7560 ExecuteNonQuery net6.0 1.93μs 8.57ns 33.2ns 0 0 0 1.02 KB
#7560 ExecuteNonQuery netcoreapp3.1 2.63μs 7.98ns 30.9ns 0 0 0 1.02 KB
#7560 ExecuteNonQuery net472 2.97μs 3.34ns 12.9ns 0.15 0.015 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.7μs 7.41ns 27.7ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.23μs 7.38ns 26.6ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.56μs 3.18ns 12.3ns 0.161 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.8μs 1.26ns 4.56ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.32μs 11.2ns 46.2ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.84μs 4.65ns 18ns 0.173 0 0 1.1 KB
#7560 CallElasticsearch net6.0 1.69μs 4.39ns 17ns 0 0 0 1.03 KB
#7560 CallElasticsearch netcoreapp3.1 2.24μs 9.77ns 37.9ns 0 0 0 1.03 KB
#7560 CallElasticsearch net472 3.44μs 2.79ns 10.8ns 0.155 0 0 1.04 KB
#7560 CallElasticsearchAsync net6.0 1.83μs 0.826ns 2.98ns 0 0 0 1.01 KB
#7560 CallElasticsearchAsync netcoreapp3.1 2.42μs 10.4ns 40.4ns 0 0 0 1.08 KB
#7560 CallElasticsearchAsync net472 3.55μs 1.6ns 6.19ns 0.16 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 5.4ns 20.9ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.5μs 3.77ns 14.6ns 0 0 0 952 B
master ExecuteAsync net472 2.52μs 0.907ns 3.51ns 0.138 0 0 915 B
#7560 ExecuteAsync net6.0 1.86μs 9.34ns 42.8ns 0 0 0 952 B
#7560 ExecuteAsync netcoreapp3.1 2.36μs 7.78ns 30.1ns 0 0 0 952 B
#7560 ExecuteAsync net472 2.65μs 6.01ns 23.3ns 0.132 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μs 4.77ns 17.8ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 9.15μs 26.8ns 104ns 0 0 0 2.9 KB
master SendAsync net472 12μs 6.39ns 23.9ns 0.481 0 0 3.18 KB
#7560 SendAsync net6.0 7.02μs 18.1ns 69.9ns 0 0 0 2.36 KB
#7560 SendAsync netcoreapp3.1 8.89μs 31.7ns 123ns 0 0 0 2.9 KB
#7560 SendAsync net472 12.3μs 6.49ns 23.4ns 0.488 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7560

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 258.66 KB 274.47 KB 15.82 KB 6.11%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 278.53 KB 286.72 KB 8.19 KB 2.94%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 43.19 KB 43.57 KB 376 B 0.87%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 43.44 KB 43.78 KB 336 B 0.77%

Fewer allocations 🎉 in #7560

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 65.54 KB 57.34 KB -8.19 KB -12.50%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 45.5μs 252ns 2.09μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 50μs 290ns 2.28μs 0 0 0 43.19 KB
master StringConcatBenchmark net472 58.2μs 169ns 632ns 0 0 0 65.54 KB
master StringConcatAspectBenchmark net6.0 459μs 1.55μs 6.22μs 0 0 0 258.88 KB
master StringConcatAspectBenchmark netcoreapp3.1 523μs 2.54μs 10.8μs 0 0 0 258.66 KB
master StringConcatAspectBenchmark net472 411μs 2.07μs 10.5μs 0 0 0 278.53 KB
#7560 StringConcatBenchmark net6.0 50.4μs 346ns 3.25μs 0 0 0 43.78 KB
#7560 StringConcatBenchmark netcoreapp3.1 50.7μs 217ns 1.42μs 0 0 0 43.57 KB
#7560 StringConcatBenchmark net472 56.9μs 245ns 950ns 0 0 0 57.34 KB
#7560 StringConcatAspectBenchmark net6.0 466μs 1.73μs 8.63μs 0 0 0 257.83 KB
#7560 StringConcatAspectBenchmark netcoreapp3.1 513μs 2.43μs 9.71μs 0 0 0 274.47 KB
#7560 StringConcatAspectBenchmark net472 414μs 2.18μs 10.5μ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.67μs 13.7ns 61.1ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.58μs 9.86ns 38.2ns 0 0 0 1.7 KB
master EnrichedLog net472 3.97μs 3.72ns 14.4ns 0.257 0 0 1.64 KB
#7560 EnrichedLog net6.0 2.6μs 14.1ns 76ns 0 0 0 1.7 KB
#7560 EnrichedLog netcoreapp3.1 3.78μs 17.4ns 69.7ns 0 0 0 1.7 KB
#7560 EnrichedLog net472 4.03μs 3.93ns 15.2ns 0.242 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 72.1ns 260ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 128μs 72.6ns 262ns 0 0 0 4.31 KB
master EnrichedLog net472 166μs 232ns 897ns 0 0 0 4.52 KB
#7560 EnrichedLog net6.0 125μs 503ns 1.95μs 0 0 0 4.31 KB
#7560 EnrichedLog netcoreapp3.1 128μs 257ns 994ns 0 0 0 4.31 KB
#7560 EnrichedLog net472 167μs 120ns 465ns 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μs 23.5ns 97ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.9μs 28.4ns 110ns 0 0 0 2.26 KB
master EnrichedLog net472 7.58μs 4.68ns 17.5ns 0.301 0 0 2.08 KB
#7560 EnrichedLog net6.0 4.93μs 24.2ns 106ns 0 0 0 2.26 KB
#7560 EnrichedLog netcoreapp3.1 6.87μs 21.2ns 82.2ns 0 0 0 2.26 KB
#7560 EnrichedLog net472 7.49μs 5.15ns 20ns 0.297 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 2.01μs 1.23ns 4.61ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.52μs 12ns 48.2ns 0 0 0 1.2 KB
master SendReceive net472 3.19μs 5.06ns 19.6ns 0.189 0 0 1.2 KB
#7560 SendReceive net6.0 2.03μs 1.24ns 4.81ns 0 0 0 1.2 KB
#7560 SendReceive netcoreapp3.1 2.69μs 14ns 67.2ns 0 0 0 1.2 KB
#7560 SendReceive net472 3.16μs 6.54ns 25.3ns 0.19 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.31μs 13.3ns 49.9ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.59μs 5.7ns 22.1ns 0 0 0 1.63 KB
master EnrichedLog net472 6.92μs 6.43ns 24.1ns 0.311 0 0 2.03 KB
#7560 EnrichedLog net6.0 4.31μs 9.23ns 35.8ns 0 0 0 1.58 KB
#7560 EnrichedLog netcoreapp3.1 5.72μs 4.89ns 18.9ns 0 0 0 1.63 KB
#7560 EnrichedLog net472 6.5μs 9.56ns 37ns 0.29 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 788ns 4.15ns 20.3ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 973ns 4.79ns 19.7ns 0 0 0 576 B
master StartFinishSpan net472 942ns 0.772ns 2.99ns 0.09 0 0 578 B
master StartFinishScope net6.0 930ns 4.96ns 24.8ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.17μs 6.38ns 36.1ns 0 0 0 696 B
master StartFinishScope net472 1.18μs 0.919ns 3.44ns 0.1 0 0 658 B
#7560 StartFinishSpan net6.0 781ns 0.218ns 0.816ns 0 0 0 576 B
#7560 StartFinishSpan netcoreapp3.1 942ns 4.7ns 21ns 0 0 0 576 B
#7560 StartFinishSpan net472 987ns 1.23ns 4.62ns 0.0891 0 0 578 B
#7560 StartFinishScope net6.0 915ns 4.74ns 23.2ns 0 0 0 696 B
#7560 StartFinishScope netcoreapp3.1 1.19μs 0.779ns 2.91ns 0 0 0 696 B
#7560 StartFinishScope net472 1.14μs 0.349ns 1.35ns 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.08μs 5.6ns 22.4ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.49μs 5.97ns 23.1ns 0 0 0 696 B
master RunOnMethodBegin net472 1.45μs 0.655ns 2.45ns 0.102 0 0 658 B
#7560 RunOnMethodBegin net6.0 1.06μs 4.94ns 19.1ns 0 0 0 696 B
#7560 RunOnMethodBegin netcoreapp3.1 1.45μs 1.91ns 7.41ns 0 0 0 696 B
#7560 RunOnMethodBegin net472 1.42μs 0.698ns 2.7ns 0.1 0 0 658 B

try
{
Length = (nuint)encoding.GetBytes(strPtr, str.Length, (byte*)Ptr, maxBytesCount);
*((byte*)Ptr + Length) = 0; // Add null terminator

Check failure

Code scanning / CodeQL

Unvalidated local pointer arithmetic

Unvalidated pointer arithmetic from virtual method [GetBytes](1).

Copilot Autofix

AI about 1 month ago

To fix this problem, the result from the virtual method call (encoding.GetBytes) must be validated to ensure it is both non-negative and does not exceed the allocated buffer size (maxBytesCount), before using it in pointer arithmetic or memory access operations. In this instance, we should check that Length >= 0 && Length <= (nuint)maxBytesCount before writing the null terminator at *((byte*)Ptr + Length). If the value is outside this range, we should fail by freeing the allocation and setting Ptr and Length appropriately so the struct is left in a valid state and does not attempt an out-of-bounds write. All code changes need to be inside the CString(string? str) constructor in tracer/src/Datadog.Trace/LibDatadog/CString.cs.


Suggested changeset 1
tracer/src/Datadog.Trace/LibDatadog/CString.cs

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tracer/src/Datadog.Trace/LibDatadog/CString.cs b/tracer/src/Datadog.Trace/LibDatadog/CString.cs
--- a/tracer/src/Datadog.Trace/LibDatadog/CString.cs
+++ b/tracer/src/Datadog.Trace/LibDatadog/CString.cs
@@ -36,7 +36,17 @@
                     try
                     {
                         Length = (nuint)encoding.GetBytes(strPtr, str.Length, (byte*)Ptr, maxBytesCount);
-                        *((byte*)Ptr + Length) = 0; // Add null terminator
+                        if (Length > (nuint)maxBytesCount)
+                        {
+                            // Prevent out-of-bounds write (should never happen with correct/built-in encoding)
+                            Marshal.FreeHGlobal(Ptr);
+                            Ptr = IntPtr.Zero;
+                            Length = UIntPtr.Zero;
+                        }
+                        else
+                        {
+                            *((byte*)Ptr + Length) = 0; // Add null terminator
+                        }
                     }
                     catch
                     {
EOF
@@ -36,7 +36,17 @@
try
{
Length = (nuint)encoding.GetBytes(strPtr, str.Length, (byte*)Ptr, maxBytesCount);
*((byte*)Ptr + Length) = 0; // Add null terminator
if (Length > (nuint)maxBytesCount)
{
// Prevent out-of-bounds write (should never happen with correct/built-in encoding)
Marshal.FreeHGlobal(Ptr);
Ptr = IntPtr.Zero;
Length = UIntPtr.Zero;
}
else
{
*((byte*)Ptr + Length) = 0; // Add null terminator
}
}
catch
{
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@gleocadie gleocadie force-pushed the gleocadie/bump-to-libdatadog-21 branch from 3b52168 to 709579a Compare November 5, 2025 13:21
@gleocadie gleocadie changed the title [Profiler/Tracer] Bump to libdatadog v21 [Profiler/Tracer] Bump to libdatadog v23 Nov 5, 2025
@gleocadie gleocadie force-pushed the gleocadie/bump-to-libdatadog-21 branch 2 times, most recently from c7e8436 to 4fa0ff5 Compare November 5, 2025 16:39
@gleocadie gleocadie force-pushed the gleocadie/bump-to-libdatadog-21 branch from 7405a75 to 48c3b9d Compare November 17, 2025 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:profiler Issues related to the continous-profiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants