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

🧪 29 Tests failed

CheckTimestampAsLabel from Datadog.Profiler.IntegrationTests.Timeline.TimelineTest (Datadog)

Actual:   Falsemples.BuggyBits.exe" should be 0 instead of 255 (= 0xFF)
WhenUsingDataPipeline_WritesLibdatadogLogs from Datadog.Trace.ClrProfiler.IntegrationTests.InstrumentationTests (Datadog)
Expected File.ReadAllText(filename) not to be <null> or whitespace, but found "".
WhenUsingDataPipeline_WritesLibdatadogLogs from Datadog.Trace.ClrProfiler.IntegrationTests.InstrumentationTests (Datadog)
Expected File.ReadAllText(filename) not to be <null> or whitespace, but found "".
View all

ℹ️ Info

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7405a75 | 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
duration74.77 ± (74.81 - 75.73) ms73.49 ± (73.60 - 74.23) ms-1.7%
.NET Framework 4.8 - Bailout
duration78.90 ± (78.98 - 79.69) ms78.11 ± (77.95 - 78.56) ms-1.0%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1092.49 ± (1092.97 - 1101.04) ms1099.15 ± (1100.63 - 1110.24) ms+0.6%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.98 ± (22.90 - 23.06) ms22.83 ± (22.77 - 22.90) ms-0.6%
process.time_to_main_ms87.58 ± (87.15 - 88.02) ms85.52 ± (85.17 - 85.86) ms-2.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.90 ± (10.89 - 10.90) MB10.86 ± (10.86 - 10.86) MB-0.3%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.81 ± (22.74 - 22.87) ms22.80 ± (22.74 - 22.87) ms-0.0%
process.time_to_main_ms88.24 ± (87.90 - 88.57) ms87.87 ± (87.41 - 88.33) ms-0.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.94 ± (10.93 - 10.94) MB10.90 ± (10.90 - 10.90) MB-0.3%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms220.11 ± (219.05 - 221.16) ms217.45 ± (216.12 - 218.78) ms-1.2%
process.time_to_main_ms545.21 ± (543.98 - 546.43) ms543.44 ± (542.05 - 544.84) ms-0.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed52.63 ± (52.61 - 52.65) MB52.47 ± (52.45 - 52.49) MB-0.3%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.5%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms21.58 ± (21.51 - 21.65) ms21.76 ± (21.69 - 21.84) ms+0.8%✅⬆️
process.time_to_main_ms75.26 ± (74.94 - 75.57) ms75.82 ± (75.44 - 76.20) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.60 ± (10.59 - 10.60) MB10.60 ± (10.60 - 10.60) MB+0.0%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.51 ± (21.45 - 21.57) ms21.56 ± (21.49 - 21.62) ms+0.2%✅⬆️
process.time_to_main_ms76.30 ± (75.94 - 76.65) ms75.42 ± (75.10 - 75.75) ms-1.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.65 ± (10.64 - 10.65) MB10.64 ± (10.64 - 10.64) MB-0.0%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms205.98 ± (204.54 - 207.43) ms204.30 ± (202.81 - 205.80) ms-0.8%
process.time_to_main_ms511.62 ± (510.83 - 512.41) ms502.55 ± (501.47 - 503.62) ms-1.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed51.76 ± (51.72 - 51.80) MB51.61 ± (51.57 - 51.65) MB-0.3%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.79 ± (19.72 - 19.85) ms19.77 ± (19.71 - 19.83) ms-0.1%
process.time_to_main_ms74.49 ± (74.16 - 74.81) ms74.88 ± (74.49 - 75.26) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.66 - 7.67) MB7.63 ± (7.63 - 7.64) MB-0.4%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.73 ± (19.67 - 19.79) ms19.60 ± (19.55 - 19.65) ms-0.7%
process.time_to_main_ms75.27 ± (75.04 - 75.51) ms74.50 ± (74.22 - 74.78) ms-1.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.72 ± (7.71 - 7.72) MB7.68 ± (7.67 - 7.68) MB-0.5%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms188.43 ± (187.42 - 189.44) ms189.65 ± (188.60 - 190.70) ms+0.6%✅⬆️
process.time_to_main_ms486.98 ± (485.97 - 487.99) ms486.25 ± (484.86 - 487.64) ms-0.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed38.98 ± (38.94 - 39.02) MB38.74 ± (38.71 - 38.78) MB-0.6%
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
duration191.32 ± (190.93 - 191.68) ms193.62 ± (193.41 - 194.16) ms+1.2%✅⬆️
.NET Framework 4.8 - Bailout
duration194.71 ± (194.33 - 194.98) ms197.97 ± (197.73 - 198.30) ms+1.7%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1154.81 ± (1160.54 - 1170.47) ms1156.04 ± (1159.74 - 1167.99) ms+0.1%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms186.52 ± (186.14 - 186.89) ms187.93 ± (187.56 - 188.29) ms+0.8%✅⬆️
process.time_to_main_ms80.34 ± (80.11 - 80.57) ms80.78 ± (80.53 - 81.02) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.09 ± (16.06 - 16.12) MB16.06 ± (16.04 - 16.09) MB-0.2%
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (19 - 20)+0.3%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms185.60 ± (185.25 - 185.95) ms187.10 ± (186.78 - 187.43) ms+0.8%✅⬆️
process.time_to_main_ms81.39 ± (81.21 - 81.56) ms82.08 ± (81.90 - 82.27) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.17 ± (16.14 - 16.20) MB16.11 ± (16.08 - 16.14) MB-0.4%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-0.5%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms392.07 ± (389.61 - 394.53) ms391.97 ± (389.49 - 394.45) ms-0.0%
process.time_to_main_ms513.73 ± (513.00 - 514.45) ms513.51 ± (512.87 - 514.16) ms-0.0%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed62.93 ± (62.78 - 63.09) MB62.41 ± (62.26 - 62.57) MB-0.8%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.0%
.NET 6 - Baseline
process.internal_duration_ms189.61 ± (189.18 - 190.04) ms190.61 ± (190.27 - 190.95) ms+0.5%✅⬆️
process.time_to_main_ms68.97 ± (68.79 - 69.16) ms69.36 ± (69.22 - 69.49) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed15.89 ± (15.73 - 16.05) MB16.02 ± (15.88 - 16.16) MB+0.8%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 19)+1.6%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms190.35 ± (189.97 - 190.74) ms190.86 ± (190.50 - 191.22) ms+0.3%✅⬆️
process.time_to_main_ms70.44 ± (70.28 - 70.60) ms70.65 ± (70.51 - 70.79) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed15.90 ± (15.73 - 16.07) MB16.15 ± (16.02 - 16.28) MB+1.6%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)20 ± (19 - 20)+3.4%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms408.75 ± (405.58 - 411.92) ms410.78 ± (407.60 - 413.97) ms+0.5%✅⬆️
process.time_to_main_ms484.54 ± (483.98 - 485.10) ms480.02 ± (479.44 - 480.60) ms-0.9%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed62.00 ± (61.85 - 62.16) MB61.92 ± (61.77 - 62.06) MB-0.1%
runtime.dotnet.threads.count30 ± (29 - 30)29 ± (29 - 29)-0.2%
.NET 8 - Baseline
process.internal_duration_ms188.53 ± (188.15 - 188.91) ms190.72 ± (190.29 - 191.16) ms+1.2%✅⬆️
process.time_to_main_ms68.92 ± (68.73 - 69.11) ms69.37 ± (69.19 - 69.55) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.72 ± (11.70 - 11.75) MB11.70 ± (11.68 - 11.72) MB-0.2%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+1.0%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms188.68 ± (188.20 - 189.15) ms189.95 ± (189.52 - 190.38) ms+0.7%✅⬆️
process.time_to_main_ms69.88 ± (69.72 - 70.04) ms70.44 ± (70.27 - 70.61) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.76 ± (11.72 - 11.80) MB11.76 ± (11.74 - 11.79) MB+0.0%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.6%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms356.37 ± (354.86 - 357.88) ms360.50 ± (358.87 - 362.13) ms+1.2%✅⬆️
process.time_to_main_ms462.29 ± (461.64 - 462.95) ms457.37 ± (456.71 - 458.02) ms-1.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.49 ± (50.46 - 50.53) MB50.26 ± (50.22 - 50.30) MB-0.5%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.3%
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 (74ms)  : 69, 79
    master - mean (75ms)  : 68, 82

    section Bailout
    This PR (7560) - mean (78ms)  : 74, 83
    master - mean (79ms)  : 74, 84

    section CallTarget+Inlining+NGEN
    This PR (7560) - mean (1,105ms)  : 1037, 1174
    master - mean (1,097ms)  : 1039, 1155

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 (116ms)  : 110, 122
    master - mean (118ms)  : 110, 126

    section Bailout
    This PR (7560) - mean (118ms)  : 110, 127
    master - mean (118ms)  : 113, 124

    section CallTarget+Inlining+NGEN
    This PR (7560) - mean (794ms)  : 751, 836
    master - mean (805ms)  : 777, 834

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7560) - mean (105ms)  : 96, 114
    master - mean (104ms)  : 98, 109

    section Bailout
    This PR (7560) - mean (104ms)  : 98, 110
    master - mean (105ms)  : 99, 111

    section CallTarget+Inlining+NGEN
    This PR (7560) - mean (741ms)  : 702, 779
    master - mean (759ms)  : 726, 792

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

    section Bailout
    This PR (7560) - mean (102ms)  : 96, 109
    master - mean (103ms)  : 98, 109

    section CallTarget+Inlining+NGEN
    This PR (7560) - mean (706ms)  : 668, 743
    master - mean (719ms)  : 694, 744

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 (194ms)  : 190, 197
    master - mean (191ms)  : 188, 195

    section Bailout
    This PR (7560) - mean (198ms)  : 195, 201
    master - mean (195ms)  : 191, 198

    section CallTarget+Inlining+NGEN
    This PR (7560) - mean (1,164ms)  : 1105, 1223
    master - mean (1,166ms)  : 1090, 1241

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)  : 272, 283
    master - mean (275ms)  : 269, 281

    section Bailout
    This PR (7560) - mean (277ms)  : 273, 281
    master - mean (275ms)  : 271, 280

    section CallTarget+Inlining+NGEN
    This PR (7560) - mean (938ms)  : 895, 982
    master - mean (943ms)  : 904, 981

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7560) - mean (268ms)  : 264, 272
    master - mean (267ms)  : 261, 273

    section Bailout
    This PR (7560) - mean (269ms)  : 265, 273
    master - mean (269ms)  : 262, 276

    section CallTarget+Inlining+NGEN
    This PR (7560) - mean (921ms)  : 872, 970
    master - mean (925ms)  : 878, 973

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7560) - mean (270ms)  : 262, 278
    master - mean (267ms)  : 261, 272

    section Bailout
    This PR (7560) - mean (270ms)  : 263, 277
    master - mean (268ms)  : 260, 275

    section CallTarget+Inlining+NGEN
    This PR (7560) - mean (849ms)  : 829, 869
    master - mean (849ms)  : 822, 877

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:

  • All benchmarks have the same speed
  • 6 benchmarks have fewer allocations
  • 8 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 ✔️ More allocations ⚠️

More allocations ⚠️ in #7560

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 5.99 KB 6.09 KB 98 B 1.64%
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑netcoreapp3.1 5.67 KB 5.72 KB 48 B 0.85%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.4μs 58.6ns 389ns 0 0 0 5.52 KB
master StartStopWithChild netcoreapp3.1 14.2μs 72.1ns 330ns 0 0 0 5.67 KB
master StartStopWithChild net472 22.4μs 88.4ns 342ns 1.05 0.418 0.105 5.99 KB
#7560 StartStopWithChild net6.0 10.7μs 59.4ns 366ns 0 0 0 5.49 KB
#7560 StartStopWithChild netcoreapp3.1 13.5μs 64.6ns 259ns 0 0 0 5.72 KB
#7560 StartStopWithChild net472 21.7μs 123ns 870ns 1.01 0.335 0.112 6.09 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7560

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 3.35 KB 3.31 KB -46 B -1.37%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 927μs 64.7ns 242ns 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.06ms 846ns 3.28μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.19ms 71.4ns 267ns 0 0 0 3.35 KB
#7560 WriteAndFlushEnrichedTraces net6.0 928μs 41.8ns 145ns 0 0 0 2.71 KB
#7560 WriteAndFlushEnrichedTraces netcoreapp3.1 1.04ms 295ns 1.14μs 0 0 0 2.7 KB
#7560 WriteAndFlushEnrichedTraces net472 1.22ms 1.08μs 4.16μs 0 0 0 3.31 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 1.07μs 1.45ns 5.62ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.46μs 7.77ns 38.9ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.03μs 0.654ns 2.53ns 0.195 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 6.99μs 35.2ns 153ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 9.01μs 24.8ns 96.2ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.6μs 4.46ns 17.3ns 0.726 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 325ns 1.22ns 4.71ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 414ns 2.12ns 9.94ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 295ns 0.0121ns 0.0419ns 0.0432 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.43μs 1.62ns 6.26ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.81μs 36.9ns 143ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.73μs 4.21ns 16.3ns 0.574 0 0 3.8 KB
#7560 AllCycleSimpleBody net6.0 1.07μs 6.07ns 45.4ns 0 0 0 1.22 KB
#7560 AllCycleSimpleBody netcoreapp3.1 1.42μs 7.91ns 51.3ns 0 0 0 1.2 KB
#7560 AllCycleSimpleBody net472 1.02μs 0.411ns 1.59ns 0.193 0 0 1.23 KB
#7560 AllCycleMoreComplexBody net6.0 7.07μs 35.7ns 156ns 0 0 0 4.72 KB
#7560 AllCycleMoreComplexBody netcoreapp3.1 9.15μs 35.1ns 136ns 0 0 0 4.62 KB
#7560 AllCycleMoreComplexBody net472 7.65μs 2.55ns 9.89ns 0.728 0 0 4.74 KB
#7560 ObjectExtractorSimpleBody net6.0 321ns 0.374ns 1.4ns 0 0 0 280 B
#7560 ObjectExtractorSimpleBody netcoreapp3.1 407ns 2.05ns 9.18ns 0 0 0 272 B
#7560 ObjectExtractorSimpleBody net472 299ns 0.0177ns 0.0663ns 0.0436 0 0 281 B
#7560 ObjectExtractorMoreComplexBody net6.0 6.33μs 3.63ns 14.1ns 0 0 0 3.78 KB
#7560 ObjectExtractorMoreComplexBody netcoreapp3.1 7.93μs 28.9ns 108ns 0 0 0 3.69 KB
#7560 ObjectExtractorMoreComplexBody net472 6.67μs 1.63ns 6.31ns 0.603 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.7μs 260ns 971ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 98.4μs 168ns 649ns 0 0 0 32.4 KB
master EncodeArgs net472 112μs 20.3ns 78.5ns 5.04 0 0 32.51 KB
master EncodeLegacyArgs net6.0 146μs 216ns 837ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 201μs 577ns 2.23μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 261μs 20.2ns 75.7ns 0 0 0 2.17 KB
#7560 EncodeArgs net6.0 77.5μs 312ns 1.08μs 0 0 0 32.4 KB
#7560 EncodeArgs netcoreapp3.1 97.7μs 231ns 894ns 0 0 0 32.4 KB
#7560 EncodeArgs net472 109μs 14.9ns 57.7ns 4.92 0 0 32.5 KB
#7560 EncodeLegacyArgs net6.0 146μs 24.4ns 91.3ns 0 0 0 2.15 KB
#7560 EncodeLegacyArgs netcoreapp3.1 198μs 45.7ns 171ns 0 0 0 2.15 KB
#7560 EncodeLegacyArgs net472 265μs 52ns 201ns 0 0 0 2.16 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 400μs 102ns 368ns 0 0 0 4.56 KB
master RunWafRealisticBenchmark netcoreapp3.1 828μs 13.1μs 131μs 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 429μs 30.2ns 113ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 287μs 85.1ns 318ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 309μs 221ns 827ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 309μs 29.2ns 109ns 0 0 0 2.29 KB
#7560 RunWafRealisticBenchmark net6.0 394μs 33.8ns 131ns 0 0 0 4.55 KB
#7560 RunWafRealisticBenchmark netcoreapp3.1 822μs 13.9μs 135μs 0 0 0 4.48 KB
#7560 RunWafRealisticBenchmark net472 429μs 38.6ns 139ns 0 0 0 4.66 KB
#7560 RunWafRealisticBenchmarkWithAttack net6.0 283μs 18.7ns 64.9ns 0 0 0 2.24 KB
#7560 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 300μs 196ns 733ns 0 0 0 2.22 KB
#7560 RunWafRealisticBenchmarkWithAttack net472 310μs 31.6ns 123ns 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.1μs 60.4ns 218ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 72.8μs 98.1ns 367ns 0 0 0 17.42 KB
master SendRequest net472 0.00895ns 0.0023ns 0.00862ns 0 0 0 0 b
#7560 SendRequest net6.0 60.9μs 95.8ns 359ns 0 0 0 14.52 KB
#7560 SendRequest netcoreapp3.1 71.2μs 84.5ns 316ns 0 0 0 17.42 KB
#7560 SendRequest net472 0.0117ns 0.00291ns 0.0113ns 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.OptimizedCharSlice‑net472 0 b 73 B 73 B
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472 0 b 49 B 49 B

Fewer allocations 🎉 in #7560

Benchmark Base Allocated Diff Allocated Change Change %
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.95ms 5.87μs 22.7μs 0 0 0 640.01 KB
master OriginalCharSlice netcoreapp3.1 2.08ms 6.07μs 23.5μs 0 0 0 640 KB
master OriginalCharSlice net472 2.59ms 529ns 1.91μs 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.46ms 320ns 1.24μs 0 0 0 4 B
master OptimizedCharSlice netcoreapp3.1 1.75ms 544ns 2.11μs 0 0 0 1 B
master OptimizedCharSlice net472 1.9ms 262ns 1.02μs 0 0 0 0 b
master OptimizedCharSliceWithPool net6.0 826μs 26.8ns 100ns 0 0 0 4 B
master OptimizedCharSliceWithPool netcoreapp3.1 840μs 141ns 544ns 0 0 0 1 B
master OptimizedCharSliceWithPool net472 1.22ms 248ns 959ns 0 0 0 0 b
#7560 OriginalCharSlice net6.0 1.9ms 6.5μs 25.2μs 0 0 0 640 KB
#7560 OriginalCharSlice netcoreapp3.1 2.14ms 2.65μs 9.55μs 0 0 0 640 KB
#7560 OriginalCharSlice net472 2.65ms 96.3ns 360ns 100 0 0 641.95 KB
#7560 OptimizedCharSlice net6.0 1.39ms 421ns 1.63μs 0 0 0 4 B
#7560 OptimizedCharSlice netcoreapp3.1 1.72ms 426ns 1.65μs 0 0 0 1 B
#7560 OptimizedCharSlice net472 1.98ms 284ns 1.1μs 0 0 0 73 B
#7560 OptimizedCharSliceWithPool net6.0 863μs 29.3ns 110ns 0 0 0 4 B
#7560 OptimizedCharSliceWithPool netcoreapp3.1 827μs 103ns 400ns 0 0 0 0 b
#7560 OptimizedCharSliceWithPool net472 1.13ms 86.1ns 333ns 0 0 0 49 B
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7560

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 56.12 KB 56.53 KB 408 B 0.73%

Fewer allocations 🎉 in #7560

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 42.17 KB 41.88 KB -296 B -0.70%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 642μs 488ns 1.89μs 0 0 0 41.65 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 692μs 2.32μs 8.38μs 0 0 0 42.17 KB
master WriteAndFlushEnrichedTraces net472 897μs 4.28μs 16.6μs 8.33 0 0 56.12 KB
#7560 WriteAndFlushEnrichedTraces net6.0 669μs 1.26μs 4.89μs 0 0 0 41.67 KB
#7560 WriteAndFlushEnrichedTraces netcoreapp3.1 682μs 1.59μs 6.92μs 0 0 0 41.88 KB
#7560 WriteAndFlushEnrichedTraces net472 887μs 3.74μs 14.5μs 8.33 0 0 56.53 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 1.28ns 4.78ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.68μs 11.8ns 45.6ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.9μs 6.14ns 21.3ns 0.144 0.0144 0 987 B
#7560 ExecuteNonQuery net6.0 1.95μs 9.28ns 37.1ns 0 0 0 1.02 KB
#7560 ExecuteNonQuery netcoreapp3.1 2.67μs 12.8ns 49.8ns 0 0 0 1.02 KB
#7560 ExecuteNonQuery net472 2.76μs 7.86ns 31.4ns 0.15 0.0136 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.74μs 0.596ns 2.31ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.2μs 11.4ns 54.5ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.52μs 1.9ns 7.36ns 0.158 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.92μs 4.09ns 15.3ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.35μs 8.99ns 33.6ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.7μs 1.85ns 6.93ns 0.166 0 0 1.1 KB
#7560 CallElasticsearch net6.0 1.67μs 8.93ns 47.3ns 0 0 0 1.03 KB
#7560 CallElasticsearch netcoreapp3.1 2.23μs 10.3ns 41.1ns 0 0 0 1.03 KB
#7560 CallElasticsearch net472 3.58μs 4.49ns 16.8ns 0.16 0 0 1.04 KB
#7560 CallElasticsearchAsync net6.0 1.84μs 1.81ns 7.01ns 0 0 0 1.01 KB
#7560 CallElasticsearchAsync netcoreapp3.1 2.38μs 7.71ns 29.9ns 0 0 0 1.08 KB
#7560 CallElasticsearchAsync net472 3.63μs 2.47ns 9.24ns 0.164 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.83μs 1.05ns 3.95ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.53μs 11.6ns 44.8ns 0 0 0 952 B
master ExecuteAsync net472 2.56μs 1.3ns 5.04ns 0.142 0 0 915 B
#7560 ExecuteAsync net6.0 2.02μs 10.3ns 50.2ns 0 0 0 952 B
#7560 ExecuteAsync netcoreapp3.1 2.58μs 7.34ns 28.4ns 0 0 0 952 B
#7560 ExecuteAsync net472 2.64μs 1.37ns 5.11ns 0.133 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 6.86μs 10.9ns 40.8ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.33μs 26.3ns 102ns 0 0 0 2.9 KB
master SendAsync net472 12.1μs 7.49ns 28ns 0.482 0 0 3.18 KB
#7560 SendAsync net6.0 6.92μs 20.3ns 78.6ns 0 0 0 2.36 KB
#7560 SendAsync netcoreapp3.1 8.62μs 41.4ns 166ns 0 0 0 2.9 KB
#7560 SendAsync net472 12.5μs 9.13ns 35.4ns 0.497 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.StringConcatBenchmark‑net472 57.34 KB 65.54 KB 8.19 KB 14.29%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 278.53 KB 286.72 KB 8.19 KB 2.94%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 274.06 KB 277.85 KB 3.79 KB 1.38%

Fewer allocations 🎉 in #7560

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 44.04 KB 42.78 KB -1.26 KB -2.85%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 46.16 KB 44.01 KB -2.15 KB -4.66%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 278.21 KB 260.96 KB -17.25 KB -6.20%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 43.2μs 260ns 2.45μs 0 0 0 46.16 KB
master StringConcatBenchmark netcoreapp3.1 46.8μs 168ns 606ns 0 0 0 44.04 KB
master StringConcatBenchmark net472 56.8μs 227ns 849ns 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 470μs 1.36μs 4.71μs 0 0 0 278.21 KB
master StringConcatAspectBenchmark netcoreapp3.1 553μs 1.31μs 4.9μs 0 0 0 274.06 KB
master StringConcatAspectBenchmark net472 411μs 2.01μs 13.3μs 0 0 0 278.53 KB
#7560 StringConcatBenchmark net6.0 43.2μs 304ns 2.84μs 0 0 0 44.01 KB
#7560 StringConcatBenchmark netcoreapp3.1 49.4μs 504ns 4.75μs 0 0 0 42.78 KB
#7560 StringConcatBenchmark net472 57μs 127ns 459ns 0 0 0 65.54 KB
#7560 StringConcatAspectBenchmark net6.0 471μs 1.9μs 8.06μs 0 0 0 260.96 KB
#7560 StringConcatAspectBenchmark netcoreapp3.1 520μs 3.01μs 24.1μs 0 0 0 277.85 KB
#7560 StringConcatAspectBenchmark net472 401μs 2.15μs 11.1μ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.68μs 10.7ns 41.6ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.6μs 17ns 70.3ns 0 0 0 1.7 KB
master EnrichedLog net472 4.04μs 4.82ns 18ns 0.24 0 0 1.64 KB
#7560 EnrichedLog net6.0 2.7μs 14.1ns 70.6ns 0 0 0 1.7 KB
#7560 EnrichedLog netcoreapp3.1 3.68μs 10.9ns 42.1ns 0 0 0 1.7 KB
#7560 EnrichedLog net472 4.23μs 3.22ns 12.5ns 0.256 0 0 1.64 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 137μs 243ns 875ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 130μs 678ns 3.96μs 0 0 0 4.31 KB
master EnrichedLog net472 174μs 980ns 6.65μs 0 0 0 4.51 KB
#7560 EnrichedLog net6.0 124μs 43.7ns 163ns 0 0 0 4.31 KB
#7560 EnrichedLog netcoreapp3.1 128μs 389ns 1.46μs 0 0 0 4.31 KB
#7560 EnrichedLog net472 168μs 125ns 486ns 0 0 0 4.52 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 4.96μs 25.1ns 109ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.68μs 30.2ns 117ns 0 0 0 2.26 KB
master EnrichedLog net472 7.55μs 9.55ns 37ns 0.3 0 0 2.08 KB
#7560 EnrichedLog net6.0 4.92μs 8.05ns 30.1ns 0 0 0 2.26 KB
#7560 EnrichedLog netcoreapp3.1 6.9μs 17.4ns 67.5ns 0 0 0 2.26 KB
#7560 EnrichedLog net472 7.63μs 5.79ns 22.4ns 0.305 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.04μs 3.2ns 12.4ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.69μs 12ns 43.1ns 0 0 0 1.2 KB
master SendReceive net472 3.04μs 2.74ns 10.6ns 0.183 0 0 1.2 KB
#7560 SendReceive net6.0 2μs 8.93ns 34.6ns 0 0 0 1.2 KB
#7560 SendReceive netcoreapp3.1 2.7μs 10.3ns 40ns 0 0 0 1.2 KB
#7560 SendReceive net472 3.11μs 2.86ns 10.7ns 0.187 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 16.4ns 61.5ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.77μs 9.03ns 35ns 0 0 0 1.63 KB
master EnrichedLog net472 6.52μs 7.68ns 29.7ns 0.293 0 0 2.03 KB
#7560 EnrichedLog net6.0 4.2μs 10.6ns 41ns 0 0 0 1.58 KB
#7560 EnrichedLog netcoreapp3.1 5.7μs 8.72ns 33.8ns 0 0 0 1.63 KB
#7560 EnrichedLog net472 6.58μs 7.13ns 27.6ns 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 769ns 4.12ns 21.8ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 943ns 4.54ns 17.6ns 0 0 0 576 B
master StartFinishSpan net472 919ns 0.765ns 2.96ns 0.0877 0 0 578 B
master StartFinishScope net6.0 938ns 0.458ns 1.71ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.2μs 5.39ns 20.9ns 0 0 0 696 B
master StartFinishScope net472 1.13μs 0.537ns 2.08ns 0.101 0 0 658 B
#7560 StartFinishSpan net6.0 784ns 0.288ns 1.11ns 0 0 0 576 B
#7560 StartFinishSpan netcoreapp3.1 980ns 0.896ns 3.47ns 0 0 0 576 B
#7560 StartFinishSpan net472 942ns 0.355ns 1.37ns 0.0899 0 0 578 B
#7560 StartFinishScope net6.0 937ns 0.33ns 1.28ns 0 0 0 696 B
#7560 StartFinishScope netcoreapp3.1 1.2μs 5.99ns 25.4ns 0 0 0 696 B
#7560 StartFinishScope net472 1.13μs 0.299ns 1.16ns 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.05μs 0.921ns 3.57ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.43μs 5.48ns 21.2ns 0 0 0 696 B
master RunOnMethodBegin net472 1.46μs 0.823ns 3.19ns 0.102 0 0 658 B
#7560 RunOnMethodBegin net6.0 1.03μs 5.26ns 24.7ns 0 0 0 696 B
#7560 RunOnMethodBegin netcoreapp3.1 1.39μs 5.4ns 20.9ns 0 0 0 696 B
#7560 RunOnMethodBegin net472 1.47μs 0.751ns 2.91ns 0.103 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 26 days 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 from 709579a to 496b5ca Compare November 5, 2025 13:33
@gleocadie gleocadie force-pushed the gleocadie/bump-to-libdatadog-21 branch from c7e8436 to 4fa0ff5 Compare November 5, 2025 16:39
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