Skip to content

Fix warnings native#8534

Merged
NachoEchevarria merged 3 commits into
masterfrom
nacho/FixWarningsNative
Apr 29, 2026
Merged

Fix warnings native#8534
NachoEchevarria merged 3 commits into
masterfrom
nacho/FixWarningsNative

Conversation

@NachoEchevarria

@NachoEchevarria NachoEchevarria commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

Summary of changes

Eliminates the 32 native C++ build warnings (15 unique source positions) emitted by the Windows native build.

Reason for change

Follow-up to #8519 (sample warnings). Native was the next cluster where every warning is a real fix rather than structural noise.

Implementation details

  • C4018 (signed/unsigned <): auto x = 0size_t x = 0 in 5 loops in rejit_handler.cpp and int i = 2size_t i = 2 in shared cor_profiler.cpp. Loop vars only used as indices.
  • C4267 / C4244 (size_t / ptrdiff_t narrowing into ULONG / DWORD / int API params): explicit static_cast at the call sites in calltarget_tokens.cpp, fault_tolerant_rewriter.cpp, process_helper.cpp, tracer_tokens.cpp, and the two generated .g.cpp files. All inputs bounded well below the cast range. The corresponding generator templates in tracer/build/_build/CodeGenerators/ are updated alongside the generated outputs.
  • SignatureBuilder::EnsureBufferSpace param intsize_t to match the rest of the class. Also clears a latent signed/unsigned mix in _offset + size >= _length.
  • fault_tolerant_rewriter.cpp:86,97: std::string(wstr.begin(), wstr.end())shared::ToString(wstr) (the C4244 trigger inside <xstring>). Identical behavior for ASCII generic-type names; UTF-8-correct for non-ASCII where the old form silently truncated.

Test coverage

Other details

@NachoEchevarria NachoEchevarria added the area:builds project files, build scripts, pipelines, versioning, releases, packages label Apr 28, 2026
@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented Apr 28, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8534) 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.27 ± (74.18 - 74.70) ms74.56 ± (74.50 - 75.14) ms+0.4%✅⬆️
.NET Framework 4.8 - Bailout
duration78.27 ± (78.19 - 78.74) ms77.46 ± (77.45 - 77.87) ms-1.0%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1067.85 ± (1068.18 - 1073.98) ms1075.18 ± (1075.10 - 1081.58) ms+0.7%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.74 ± (22.68 - 22.80) ms22.92 ± (22.85 - 22.99) ms+0.8%✅⬆️
process.time_to_main_ms86.87 ± (86.58 - 87.15) ms86.80 ± (86.46 - 87.14) ms-0.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.85 ± (10.85 - 10.86) MB10.91 ± (10.91 - 10.91) MB+0.5%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.35 ± (22.32 - 22.39) ms22.48 ± (22.44 - 22.52) ms+0.6%✅⬆️
process.time_to_main_ms86.28 ± (86.06 - 86.49) ms86.03 ± (85.82 - 86.24) ms-0.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.95 ± (10.94 - 10.95) MB10.94 ± (10.94 - 10.95) MB-0.0%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms213.57 ± (212.52 - 214.63) ms214.84 ± (213.85 - 215.83) ms+0.6%✅⬆️
process.time_to_main_ms528.90 ± (527.38 - 530.43) ms528.71 ± (527.18 - 530.24) ms-0.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed47.97 ± (47.93 - 48.01) MB47.98 ± (47.94 - 48.02) MB+0.0%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.9%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms21.31 ± (21.27 - 21.36) ms21.66 ± (21.60 - 21.73) ms+1.6%✅⬆️
process.time_to_main_ms73.87 ± (73.64 - 74.09) ms76.39 ± (76.11 - 76.67) ms+3.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.62 ± (10.61 - 10.62) MB10.63 ± (10.63 - 10.63) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.15 ± (21.11 - 21.20) ms21.22 ± (21.19 - 21.25) ms+0.3%✅⬆️
process.time_to_main_ms74.51 ± (74.34 - 74.67) ms74.60 ± (74.41 - 74.79) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.73 ± (10.73 - 10.73) MB10.73 ± (10.73 - 10.74) MB+0.0%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms383.29 ± (381.39 - 385.18) ms380.69 ± (378.75 - 382.64) ms-0.7%
process.time_to_main_ms527.58 ± (526.43 - 528.73) ms531.50 ± (530.19 - 532.81) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.15 ± (49.12 - 49.17) MB49.48 ± (49.45 - 49.50) MB+0.7%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 8 - Baseline
process.internal_duration_ms19.84 ± (19.78 - 19.89) ms19.51 ± (19.45 - 19.56) ms-1.7%
process.time_to_main_ms74.91 ± (74.64 - 75.17) ms72.85 ± (72.64 - 73.05) ms-2.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.65 ± (7.65 - 7.66) MB7.67 ± (7.66 - 7.67) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.51 ± (19.47 - 19.54) ms19.89 ± (19.83 - 19.95) ms+1.9%✅⬆️
process.time_to_main_ms74.05 ± (73.86 - 74.24) ms76.40 ± (76.14 - 76.65) ms+3.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.71 ± (7.70 - 7.71) MB7.71 ± (7.71 - 7.72) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms297.88 ± (295.83 - 299.93) ms304.82 ± (302.61 - 307.04) ms+2.3%✅⬆️
process.time_to_main_ms491.28 ± (490.20 - 492.37) ms492.42 ± (491.06 - 493.78) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.47 ± (36.44 - 36.50) MB36.58 ± (36.56 - 36.61) MB+0.3%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.4%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration202.09 ± (201.83 - 202.96) ms200.90 ± (200.50 - 201.59) ms-0.6%
.NET Framework 4.8 - Bailout
duration205.34 ± (205.03 - 206.03) ms204.47 ± (204.12 - 205.18) ms-0.4%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1191.39 ± (1191.87 - 1200.06) ms1185.86 ± (1183.30 - 1191.68) ms-0.5%
.NET Core 3.1 - Baseline
process.internal_duration_ms193.41 ± (192.92 - 193.89) ms194.89 ± (194.38 - 195.39) ms+0.8%✅⬆️
process.time_to_main_ms84.02 ± (83.72 - 84.32) ms84.48 ± (84.19 - 84.77) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.11 ± (16.09 - 16.12) MB16.05 ± (16.04 - 16.07) MB-0.3%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.1%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms194.20 ± (193.69 - 194.71) ms193.87 ± (193.37 - 194.38) ms-0.2%
process.time_to_main_ms85.04 ± (84.79 - 85.28) ms85.58 ± (85.34 - 85.81) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.14 ± (16.12 - 16.16) MB16.10 ± (16.09 - 16.12) MB-0.2%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)+0.2%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms385.89 ± (384.80 - 386.98) ms389.18 ± (387.97 - 390.38) ms+0.9%✅⬆️
process.time_to_main_ms526.77 ± (525.53 - 528.01) ms529.50 ± (528.29 - 530.71) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed57.14 ± (57.00 - 57.28) MB57.51 ± (57.34 - 57.68) MB+0.6%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.1%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms198.70 ± (198.21 - 199.19) ms199.39 ± (198.88 - 199.90) ms+0.3%✅⬆️
process.time_to_main_ms73.09 ± (72.85 - 73.33) ms72.86 ± (72.66 - 73.05) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.27 ± (16.25 - 16.29) MB16.38 ± (16.36 - 16.40) MB+0.7%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.2%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms199.59 ± (199.06 - 200.11) ms199.79 ± (199.31 - 200.28) ms+0.1%✅⬆️
process.time_to_main_ms74.81 ± (74.55 - 75.07) ms74.67 ± (74.41 - 74.92) ms-0.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.31 ± (16.29 - 16.33) MB16.37 ± (16.34 - 16.39) MB+0.3%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.6%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms594.70 ± (591.97 - 597.42) ms594.73 ± (592.49 - 596.97) ms+0.0%✅⬆️
process.time_to_main_ms525.02 ± (523.78 - 526.26) ms530.02 ± (528.87 - 531.17) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed60.99 ± (60.89 - 61.08) MB61.03 ± (60.93 - 61.13) MB+0.1%✅⬆️
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms197.03 ± (196.50 - 197.55) ms198.54 ± (198.01 - 199.07) ms+0.8%✅⬆️
process.time_to_main_ms72.41 ± (72.18 - 72.63) ms73.00 ± (72.77 - 73.23) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.61 ± (11.60 - 11.63) MB11.69 ± (11.67 - 11.70) MB+0.6%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.3%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms197.42 ± (196.89 - 197.94) ms198.37 ± (197.82 - 198.92) ms+0.5%✅⬆️
process.time_to_main_ms73.44 ± (73.25 - 73.63) ms73.89 ± (73.67 - 74.11) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.63 ± (11.62 - 11.65) MB11.75 ± (11.74 - 11.77) MB+1.0%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.3%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms520.81 ± (518.17 - 523.45) ms519.34 ± (516.18 - 522.50) ms-0.3%
process.time_to_main_ms486.55 ± (485.48 - 487.61) ms487.73 ± (486.63 - 488.84) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.18 ± (50.15 - 50.22) MB50.24 ± (50.20 - 50.28) MB+0.1%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+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 (8534) - mean (75ms)  : 70, 80
    master - mean (74ms)  : 71, 78

    section Bailout
    This PR (8534) - mean (78ms)  : 75, 81
    master - mean (78ms)  : 74, 83

    section CallTarget+Inlining+NGEN
    This PR (8534) - mean (1,078ms)  : 1032, 1125
    master - mean (1,071ms)  : 1029, 1113

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 (8534) - mean (117ms)  : 110, 124
    master - mean (117ms)  : 110, 123

    section Bailout
    This PR (8534) - mean (115ms)  : 113, 117
    master - mean (116ms)  : 111, 120

    section CallTarget+Inlining+NGEN
    This PR (8534) - mean (781ms)  : 759, 803
    master - mean (781ms)  : 754, 807

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

    section Bailout
    This PR (8534) - mean (102ms)  : 99, 105
    master - mean (102ms)  : 99, 105

    section CallTarget+Inlining+NGEN
    This PR (8534) - mean (941ms)  : 911, 971
    master - mean (937ms)  : 897, 977

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8534) - mean (100ms)  : 97, 103
    master - mean (103ms)  : 97, 108

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

    section CallTarget+Inlining+NGEN
    This PR (8534) - mean (829ms)  : 785, 874
    master - mean (821ms)  : 790, 852

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 (8534) - mean (201ms)  : 193, 209
    master - mean (202ms)  : 194, 211

    section Bailout
    This PR (8534) - mean (205ms)  : 197, 212
    master - mean (206ms)  : 199, 213

    section CallTarget+Inlining+NGEN
    This PR (8534) - mean (1,187ms)  : 1135, 1240
    master - mean (1,196ms)  : 1133, 1258

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 (8534) - mean (289ms)  : 275, 302
    master - mean (287ms)  : 276, 298

    section Bailout
    This PR (8534) - mean (289ms)  : 277, 301
    master - mean (288ms)  : 279, 298

    section CallTarget+Inlining+NGEN
    This PR (8534) - mean (953ms)  : 918, 989
    master - mean (949ms)  : 923, 975

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8534) - mean (281ms)  : 272, 291
    master - mean (281ms)  : 272, 290

    section Bailout
    This PR (8534) - mean (284ms)  : 273, 294
    master - mean (283ms)  : 272, 295

    section CallTarget+Inlining+NGEN
    This PR (8534) - mean (1,157ms)  : 1109, 1205
    master - mean (1,151ms)  : 1109, 1193

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8534) - mean (282ms)  : 269, 295
    master - mean (280ms)  : 268, 292

    section Bailout
    This PR (8534) - mean (283ms)  : 271, 294
    master - mean (281ms)  : 272, 290

    section CallTarget+Inlining+NGEN
    This PR (8534) - mean (1,041ms)  : 984, 1098
    master - mean (1,041ms)  : 1001, 1081

Loading

@pr-commenter

pr-commenter Bot commented Apr 28, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-04-29 10:25:51

Comparing candidate commit 18261be in PR branch nacho/FixWarningsNative with baseline commit 958612e in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 0 unstable metrics, 59 known flaky benchmarks, 28 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0

  • 🟩 throughput [+9678.673op/s; +11865.342op/s] or [+8.135%; +9.973%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+305.087ms; +309.355ms] or [+151.395%; +153.513%]
  • 🟥 throughput [-48.411op/s; -44.232op/s] or [-8.710%; -7.958%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • 🟥 execution_time [+378.692ms; +380.487ms] or [+299.190%; +300.608%]
  • 🟩 throughput [+92.364op/s; +97.732op/s] or [+12.178%; +12.886%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 execution_time [+391.340ms; +393.787ms] or [+346.321%; +348.486%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net472

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.529%; +27.541%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net6.0

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.977%; +9.987%]
  • 🟩 execution_time [-15.587ms; -11.410ms] or [-7.280%; -5.329%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody netcoreapp3.1

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+27.502%; +27.510%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net472

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.746%; +105.759%]
  • 🟥 throughput [-266011.330op/s; -263017.313op/s] or [-27.161%; -26.855%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net6.0

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.558%; +38.566%]
  • 🟩 execution_time [-26.297ms; -21.443ms] or [-11.727%; -9.563%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.292%; +105.304%]
  • 🟥 throughput [-136070.932op/s; -120042.610op/s] or [-19.551%; -17.248%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net6.0

  • 🟩 throughput [+8651.573op/s; +11562.205op/s] or [+5.505%; +7.357%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody netcoreapp3.1

  • 🟩 throughput [+6471.417op/s; +9107.386op/s] or [+5.155%; +7.255%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net6.0

  • 🟩 throughput [+352151.344op/s; +385880.527op/s] or [+11.742%; +12.867%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody netcoreapp3.1

  • 🟩 execution_time [-18.466ms; -13.963ms] or [-8.512%; -6.436%]
  • 🟩 throughput [+141422.048op/s; +196393.169op/s] or [+5.613%; +7.795%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net472

  • 🟥 execution_time [+299.095ms; +299.945ms] or [+149.448%; +149.872%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net6.0

  • 🟥 execution_time [+299.794ms; +302.944ms] or [+151.187%; +152.776%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs netcoreapp3.1

  • 🟥 execution_time [+300.519ms; +303.438ms] or [+151.378%; +152.849%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net472

  • 🟥 execution_time [+296.631ms; +297.485ms] or [+145.693%; +146.113%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0

  • 🟥 execution_time [+295.413ms; +297.036ms] or [+144.416%; +145.210%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1

  • 🟥 execution_time [+300.541ms; +301.839ms] or [+150.210%; +150.859%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net6.0

  • 🟥 execution_time [+23.797µs; +47.370µs] or [+7.597%; +15.123%]
  • 🟥 throughput [-439.861op/s; -241.479op/s] or [-13.712%; -7.528%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.536ms; +300.238ms] or [+149.499%; +149.850%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0

  • 🟥 execution_time [+411.498ms; +417.691ms] or [+447.109%; +453.839%]
  • 🟩 throughput [+1201.650op/s; +1342.853op/s] or [+9.874%; +11.034%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest netcoreapp3.1

  • unstable execution_time [+333.425ms; +361.603ms] or [+253.167%; +274.562%]
  • 🟩 throughput [+663.798op/s; +864.215op/s] or [+6.426%; +8.366%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+318.266ms; +349.236ms] or [+146.335%; +160.575%]
  • 🟥 throughput [-503.382op/s; -472.442op/s] or [-45.611%; -42.808%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • unstable execution_time [+209.964ms; +343.172ms] or [+89.478%; +146.246%]
  • 🟥 throughput [-670.908op/s; -587.412op/s] or [-44.750%; -39.181%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 execution_time [+343.376ms; +352.422ms] or [+205.379%; +210.789%]
  • 🟥 throughput [-397.173op/s; -360.235op/s] or [-27.655%; -25.083%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0

  • 🟩 execution_time [-180.472µs; -145.526µs] or [-9.142%; -7.372%]
  • 🟩 throughput [+42.051op/s; +51.445op/s] or [+8.301%; +10.156%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+301.184ms; +303.119ms] or [+151.671%; +152.645%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net6.0

  • 🟥 execution_time [+301.685ms; +303.243ms] or [+151.175%; +151.956%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch netcoreapp3.1

  • 🟥 execution_time [+302.144ms; +305.426ms] or [+151.784%; +153.433%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+301.532ms; +302.793ms] or [+151.419%; +152.052%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net6.0

  • 🟥 execution_time [+297.235ms; +299.049ms] or [+146.969%; +147.866%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync netcoreapp3.1

  • 🟥 execution_time [+304.470ms; +307.970ms] or [+154.319%; +156.093%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+299.648ms; +301.291ms] or [+150.396%; +151.221%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net6.0

  • 🟥 execution_time [+300.132ms; +303.596ms] or [+149.588%; +151.315%]
  • 🟩 throughput [+41846.459op/s; +46214.672op/s] or [+8.309%; +9.177%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync netcoreapp3.1

  • 🟥 execution_time [+300.608ms; +303.201ms] or [+149.550%; +150.840%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net472

  • unstable execution_time [+7.882µs; +48.815µs] or [+1.947%; +12.058%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net6.0

  • 🟩 allocated_mem [-19.053KB; -19.033KB] or [-6.950%; -6.943%]
  • unstable execution_time [-34.339µs; +18.918µs] or [-6.787%; +3.739%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1

  • unstable execution_time [-5.259µs; +103.084µs] or [-0.911%; +17.864%]
  • unstable throughput [-114.864op/s; +83.702op/s] or [-6.562%; +4.782%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0

  • 🟥 execution_time [+6.252µs; +10.367µs] or [+14.778%; +24.503%]
  • 🟥 throughput [-4680.378op/s; -2918.930op/s] or [-19.703%; -12.288%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark netcoreapp3.1

  • unstable execution_time [-13.942µs; -6.658µs] or [-21.630%; -10.330%]
  • 🟩 throughput [+1729.575op/s; +3235.448op/s] or [+10.612%; +19.851%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+302.373ms; +303.447ms] or [+152.836%; +153.379%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+303.078ms; +305.197ms] or [+154.266%; +155.344%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+300.952ms; +303.328ms] or [+150.664%; +151.853%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net6.0

  • 🟩 throughput [+39021.399op/s; +43217.610op/s] or [+7.386%; +8.180%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+301.374ms; +303.111ms] or [+150.208%; +151.074%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+301.235ms; +302.678ms] or [+151.266%; +151.990%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+303.717ms; +306.169ms] or [+154.026%; +155.269%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+300.640ms; +301.346ms] or [+149.961%; +150.313%]
  • 🟩 throughput [+66115488.026op/s; +66385965.033op/s] or [+48.149%; +48.346%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net6.0

  • 🟥 execution_time [+422.815ms; +427.109ms] or [+525.846%; +531.187%]
  • 🟩 throughput [+1088.054op/s; +1253.240op/s] or [+8.411%; +9.688%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore netcoreapp3.1

  • 🟥 execution_time [+299.664ms; +300.655ms] or [+149.466%; +149.960%]
  • 🟩 throughput [+18181250.943op/s; +19131332.596op/s] or [+8.053%; +8.474%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net6.0

  • 🟩 throughput [+92761.701op/s; +100736.129op/s] or [+8.661%; +9.405%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1

  • 🟩 throughput [+56543.950op/s; +75730.947op/s] or [+6.545%; +8.766%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0

  • 🟩 throughput [+78368.380op/s; +108337.650op/s] or [+6.066%; +8.386%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan netcoreapp3.1

  • 🟩 throughput [+66400.701op/s; +78749.415op/s] or [+6.595%; +7.821%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net6.0

  • 🟩 throughput [+46433.386op/s; +51014.600op/s] or [+8.431%; +9.263%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1

  • 🟩 throughput [+27095.589op/s; +36793.004op/s] or [+6.065%; +8.235%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0

  • 🟩 throughput [+68294.635op/s; +86215.599op/s] or [+7.630%; +9.632%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net6.0
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@NachoEchevarria
NachoEchevarria marked this pull request as ready for review April 28, 2026 15:00
@NachoEchevarria
NachoEchevarria requested review from a team as code owners April 28, 2026 15:00

@andrewlock andrewlock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! just a couple of questions

Comment thread shared/src/Datadog.Trace.ClrProfiler.Native/process_helper.cpp
sb.AppendLine("""
};
return trace::profiler->RegisterIastAspects((WCHAR**) callSites.data(), callSites.size(), enabledCategories, platform);
return trace::profiler->RegisterIastAspects((WCHAR**) callSites.data(), static_cast<int>(callSites.size()), enabledCategories, platform);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, this is technically casting a 64-bit type to a 32-bit type - should we instead change the target method to accept a size_t instead of int, seeing as that's what it "should" be? I think that's a safe change to make, right, because these aren't "public" method calls per-se

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, It would be cleaner, thanks. Done!

@NachoEchevarria
NachoEchevarria requested a review from a team as a code owner April 29, 2026 09:16
Comment on lines +179 to +182
// Managed callers always pass an array length, so this should never trip; assert captures
// the assumption before promoting to the size_t parameter.
assert(aspectsLength >= 0);
return trace::profiler->RegisterIastAspects(aspects, static_cast<size_t>(aspectsLength));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to make the outer RegisterIastAspects take a size_t here, too? 🤔

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was thinking about that, but that would complicate things a little bit beyond the scope of this PR because it would affect the interface between managed and native. We'd need to update the four [DllImport] declarations in NativeMethods.cs plus the RegisterIastAspects / RegisterCallTargetDefinitions C# wrappers.
Also, size_t is platform-sized (32-bit on x86, 64-bit on x64), and nuint/UIntPtr is the only managed type that matches it on both. nuint is C# 9+, that could be another issue. Also, the [MarshalAs] annotation expects the referenced parameter to be a primitive integer type — int, uint, long, ulong, short, etc. The .NET runtime documentation lists those explicitly. Whether it accepts nuint is fuzzy. That would be kind of a risky change without real benefit.

@andrewlock andrewlock Apr 29, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's fair. In which case, we should probably just drop the assert (crashing would definitely be bad!). We could consider switching to uint in the future I guess, so at least it's unsigned 🤷‍♂️

Comment thread shared/src/Datadog.Trace.ClrProfiler.Native/process_helper.cpp
@NachoEchevarria

Copy link
Copy Markdown
Collaborator Author

Thanks for the feedback and reviews!

@NachoEchevarria
NachoEchevarria merged commit 1f913f9 into master Apr 29, 2026
148 checks passed
@NachoEchevarria
NachoEchevarria deleted the nacho/FixWarningsNative branch April 29, 2026 15:57
@github-actions github-actions Bot added this to the vNext-v3 milestone Apr 29, 2026
@andrewlock andrewlock added the type:cleanup Minor code clean up label May 1, 2026
NachoEchevarria added a commit that referenced this pull request May 7, 2026
## Summary of changes

Part 3 of the warning-reduction series. ~25 warning sources eliminated
across sample/regression projects and the runner tool.

Previous PRs:
#8534
#8519

## Reason for change

CI emits ~17k warnings; chipping away at the batch surfaced after parts
1-2 merged.

## Implementation details

- **Deleted redundant `PackageReference`s** (NU1510 — flagged
framework-provided on the target TFM and not needed):
`Microsoft.AspNetCore.Mvc.RazorPages`,
`Microsoft.Extensions.Logging.Debug`,
`System.Runtime.InteropServices.RuntimeInformation`,
`System.Data.Common`, `System.Net.Http 4.3.4`, `System.IO.FileSystem`,
`System.Net.NameResolution`.
- **Targeted `<NoWarn>` (with comment explaining why the reference is
load-bearing)**:
- NU1510 for `System.Memory` / `System.Net.Http` on net4x targets —
Probes, CallTargetNativeTest, VersionConflict.{1x,2x},
DuplicateTypeProxy.
- MSTEST0001/0044/0057 + NU1701 — MSTestTests, MSTestTests2,
MSTestTestsRetries.
- NETSDK1201 — ManualInstrumentation; ASP0014 —
Ocelot.DistributedTracing.
- IL2104 — `Datadog.Trace.Tools.Runner` (third-party assemblies already
rooted via `<TrimmerRootAssembly>`).
- **Nullability fixes**: `SampleHelpers.TrySetServiceName` parameter
widened to `string?` with an early-return guard so we don't
reflection-invoke the setter with null; redundant `evaluation?.Error`
removed in `Samples.FeatureFlags/Evaluator.cs` (was de-narrowing the
flow state and tripping CS8602 on net48); `Samples.GrpcDotNet/Worker.cs`
`[CallerMemberName]` default fixed.

## Test coverage

No behavioral changes. CI verifies the warning count drops without
breaking compilation.

## Other details

---------

Co-authored-by: Andrew Lock <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:builds project files, build scripts, pipelines, versioning, releases, packages type:cleanup Minor code clean up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants