Skip to content

Attempt to prevent crash on module unload#8854

Merged
bouwkast merged 3 commits into
masterfrom
steven/try-prevent-crash-module-unload
Jul 7, 2026
Merged

Attempt to prevent crash on module unload#8854
bouwkast merged 3 commits into
masterfrom
steven/try-prevent-crash-module-unload

Conversation

@bouwkast

@bouwkast bouwkast commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary of changes

Avoid querying CLR module metadata during ModuleUnloadStarted; clean up cached profiler module/AppDomain state using locally tracked module ids instead.

Reason for change

Calling back into the CLR for module info while a module is unloading can fault inside runtime teardown and crash the instrumented process (or at least that is what it appears so).

Implementation details

Synchronize access to managed_profiler_loaded_app_domains, make the domain-neutral profiler module id atomic, remove unloaded module ids from cached profiler state, and only clean up AppDomain-scoped state after successful AppDomain unload.

This mainly removes the call to GetModuleInfo during the unload event.

Test coverage

Unsure really, I haven't been able to reproduce this hoping that existing tests cover the change 😬

Other details

https://app.datadoghq.com/error-tracking/issue/f7978b74-55cd-11f1-8366-da7ad0900002

@bouwkast

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: b9b1236649

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8854) 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
duration69.63 ± (69.68 - 69.98) ms71.75 ± (71.66 - 72.25) ms+3.0%✅⬆️
.NET Framework 4.8 - Bailout
duration73.78 ± (73.70 - 74.00) ms76.11 ± (76.08 - 76.51) ms+3.2%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1077.61 ± (1077.62 - 1084.59) ms1079.08 ± (1080.78 - 1087.18) ms+0.1%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.09 ± (22.06 - 22.13) ms22.50 ± (22.44 - 22.56) ms+1.8%✅⬆️
process.time_to_main_ms80.12 ± (79.97 - 80.26) ms83.36 ± (83.04 - 83.69) ms+4.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.91 ± (10.91 - 10.92) MB10.91 ± (10.91 - 10.92) MB+0.0%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.03 ± (21.99 - 22.06) ms22.29 ± (22.26 - 22.32) ms+1.2%✅⬆️
process.time_to_main_ms81.30 ± (81.12 - 81.48) ms82.42 ± (82.23 - 82.60) ms+1.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.96 ± (10.95 - 10.96) MB10.95 ± (10.95 - 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_ms208.61 ± (207.80 - 209.42) ms209.72 ± (208.71 - 210.74) ms+0.5%✅⬆️
process.time_to_main_ms532.58 ± (531.39 - 533.78) ms529.82 ± (528.52 - 531.13) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.21 ± (49.18 - 49.24) MB49.29 ± (49.26 - 49.33) MB+0.2%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.5%
.NET 6 - Baseline
process.internal_duration_ms21.18 ± (21.13 - 21.23) ms21.11 ± (21.06 - 21.15) ms-0.3%
process.time_to_main_ms71.39 ± (71.10 - 71.68) ms71.71 ± (71.46 - 71.96) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.63 ± (10.63 - 10.63) MB10.63 ± (10.63 - 10.63) MB+0.0%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.97 ± (20.94 - 21.01) ms20.78 ± (20.75 - 20.82) ms-0.9%
process.time_to_main_ms72.15 ± (71.95 - 72.35) ms70.88 ± (70.77 - 71.00) ms-1.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.74 ± (10.74 - 10.75) MB10.75 ± (10.75 - 10.76) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms372.98 ± (370.90 - 375.06) ms371.94 ± (369.41 - 374.48) ms-0.3%
process.time_to_main_ms534.76 ± (533.40 - 536.12) ms535.52 ± (534.47 - 536.57) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed50.29 ± (50.27 - 50.31) MB50.29 ± (50.26 - 50.31) MB-0.0%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.36 ± (19.32 - 19.41) ms19.11 ± (19.08 - 19.13) ms-1.3%
process.time_to_main_ms69.73 ± (69.53 - 69.93) ms68.83 ± (68.70 - 68.96) ms-1.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.68 ± (7.68 - 7.69) MB7.68 ± (7.67 - 7.68) MB-0.1%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.85 ± (19.80 - 19.89) ms19.33 ± (19.29 - 19.37) ms-2.6%
process.time_to_main_ms73.97 ± (73.70 - 74.25) ms72.08 ± (71.82 - 72.34) ms-2.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.72 ± (7.71 - 7.72) MB7.72 ± (7.72 - 7.73) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms298.81 ± (296.39 - 301.23) ms299.20 ± (296.89 - 301.52) ms+0.1%✅⬆️
process.time_to_main_ms487.03 ± (486.00 - 488.06) ms484.65 ± (483.63 - 485.68) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed37.73 ± (37.70 - 37.76) MB37.72 ± (37.69 - 37.75) MB-0.0%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.3%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration202.37 ± (202.06 - 203.07) ms201.54 ± (201.30 - 202.09) ms-0.4%
.NET Framework 4.8 - Bailout
duration207.52 ± (207.13 - 208.17) ms205.54 ± (205.16 - 205.95) ms-1.0%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1212.00 ± (1210.01 - 1215.65) ms1211.41 ± (1212.53 - 1218.68) ms-0.0%
.NET Core 3.1 - Baseline
process.internal_duration_ms196.15 ± (195.73 - 196.57) ms195.85 ± (195.49 - 196.22) ms-0.2%
process.time_to_main_ms84.97 ± (84.66 - 85.28) ms84.38 ± (84.12 - 84.64) ms-0.7%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.02 ± (15.99 - 16.04) MB16.07 ± (16.04 - 16.10) MB+0.3%✅⬆️
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (19 - 20)-0.1%
.NET Core 3.1 - Bailout
process.internal_duration_ms208.79 ± (208.33 - 209.24) ms195.78 ± (195.41 - 196.15) ms-6.2%
process.time_to_main_ms92.30 ± (91.88 - 92.72) ms85.89 ± (85.65 - 86.12) ms-6.9%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.04 ± (16.03 - 16.05) MB16.10 ± (16.07 - 16.13) MB+0.4%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-1.4%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms399.17 ± (397.21 - 401.12) ms388.09 ± (386.84 - 389.34) ms-2.8%
process.time_to_main_ms565.80 ± (562.58 - 569.03) ms541.98 ± (540.94 - 543.01) ms-4.2%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed59.24 ± (59.12 - 59.36) MB58.19 ± (57.97 - 58.41) MB-1.8%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-0.2%
.NET 6 - Baseline
process.internal_duration_ms202.57 ± (202.17 - 202.97) ms198.99 ± (198.57 - 199.42) ms-1.8%
process.time_to_main_ms74.60 ± (74.32 - 74.87) ms73.32 ± (73.05 - 73.59) ms-1.7%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.31 ± (16.28 - 16.33) MB16.39 ± (16.36 - 16.42) MB+0.5%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.0%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms200.53 ± (200.07 - 201.00) ms198.61 ± (198.20 - 199.02) ms-1.0%
process.time_to_main_ms74.75 ± (74.51 - 75.00) ms74.13 ± (73.89 - 74.38) ms-0.8%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.40 ± (16.37 - 16.43) MB16.43 ± (16.40 - 16.45) MB+0.1%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-0.7%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms582.70 ± (579.96 - 585.45) ms586.29 ± (583.86 - 588.71) ms+0.6%✅⬆️
process.time_to_main_ms554.00 ± (552.93 - 555.07) ms550.46 ± (549.26 - 551.65) ms-0.6%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.34 ± (61.26 - 61.43) MB61.52 ± (61.42 - 61.62) MB+0.3%✅⬆️
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)-0.3%
.NET 8 - Baseline
process.internal_duration_ms201.13 ± (200.70 - 201.56) ms197.05 ± (196.65 - 197.46) ms-2.0%
process.time_to_main_ms73.61 ± (73.37 - 73.85) ms72.42 ± (72.17 - 72.66) ms-1.6%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.67 ± (11.65 - 11.69) MB11.74 ± (11.72 - 11.77) MB+0.6%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)18 ± (18 - 18)-1.6%
.NET 8 - Bailout
process.internal_duration_ms198.18 ± (197.69 - 198.67) ms196.04 ± (195.68 - 196.40) ms-1.1%
process.time_to_main_ms73.99 ± (73.76 - 74.23) ms72.94 ± (72.76 - 73.13) ms-1.4%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.74 ± (11.72 - 11.76) MB11.78 ± (11.76 - 11.79) MB+0.3%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.1%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms515.21 ± (512.49 - 517.92) ms510.67 ± (508.01 - 513.33) ms-0.9%
process.time_to_main_ms503.95 ± (503.08 - 504.83) ms503.83 ± (502.88 - 504.77) ms-0.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed51.08 ± (51.04 - 51.11) MB51.10 ± (51.07 - 51.14) MB+0.1%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (29 - 30)-0.7%
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 (8854) - mean (72ms)  : 67, 77
    master - mean (70ms)  : 68, 72

    section Bailout
    This PR (8854) - mean (76ms)  : 73, 79
    master - mean (74ms)  : 72, 75

    section CallTarget+Inlining+NGEN
    This PR (8854) - mean (1,084ms)  : 1039, 1129
    master - mean (1,081ms)  : 1030, 1132

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 (8854) - mean (113ms)  : 106, 121
    master - mean (109ms)  : 105, 112

    section Bailout
    This PR (8854) - mean (111ms)  : 107, 116
    master - mean (110ms)  : 108, 112

    section CallTarget+Inlining+NGEN
    This PR (8854) - mean (777ms)  : 758, 797
    master - mean (779ms)  : 756, 803

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8854) - mean (99ms)  : 94, 105
    master - mean (99ms)  : 93, 106

    section Bailout
    This PR (8854) - mean (98ms)  : 96, 100
    master - mean (100ms)  : 96, 104

    section CallTarget+Inlining+NGEN
    This PR (8854) - mean (937ms)  : 887, 988
    master - mean (935ms)  : 898, 972

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

    section Bailout
    This PR (8854) - mean (100ms)  : 93, 106
    master - mean (102ms)  : 96, 108

    section CallTarget+Inlining+NGEN
    This PR (8854) - mean (811ms)  : 778, 845
    master - mean (818ms)  : 772, 863

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 (8854) - mean (202ms)  : 197, 206
    master - mean (203ms)  : 197, 208

    section Bailout
    This PR (8854) - mean (206ms)  : 202, 209
    master - mean (208ms)  : 203, 213

    section CallTarget+Inlining+NGEN
    This PR (8854) - mean (1,216ms)  : 1171, 1260
    master - mean (1,213ms)  : 1172, 1254

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 (8854) - mean (290ms)  : 285, 295
    master - mean (291ms)  : 285, 297

    section Bailout
    This PR (8854) - mean (291ms)  : 286, 297
    master - mean (312ms)  : 302, 323

    section CallTarget+Inlining+NGEN
    This PR (8854) - mean (973ms)  : 951, 995
    master - mean (1,008ms)  : 929, 1086

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8854) - mean (282ms)  : 276, 288
    master - mean (286ms)  : 279, 293

    section Bailout
    This PR (8854) - mean (282ms)  : 276, 287
    master - mean (284ms)  : 278, 290

    section CallTarget+Inlining+NGEN
    This PR (8854) - mean (1,170ms)  : 1131, 1209
    master - mean (1,168ms)  : 1133, 1203

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8854) - mean (280ms)  : 274, 286
    master - mean (285ms)  : 279, 292

    section Bailout
    This PR (8854) - mean (279ms)  : 274, 284
    master - mean (282ms)  : 276, 288

    section CallTarget+Inlining+NGEN
    This PR (8854) - mean (1,047ms)  : 1006, 1088
    master - mean (1,052ms)  : 1012, 1092

Loading

@pr-commenter

pr-commenter Bot commented Jun 30, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-30 13:56:19

Comparing candidate commit 0b13cba in PR branch steven/try-prevent-crash-module-unload with baseline commit f0fbab0 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 72 metrics, 0 unstable metrics, 59 known flaky benchmarks, 67 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 net472

  • 🟥 throughput [-9040.204op/s; -8139.867op/s] or [-10.719%; -9.651%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1

  • unstable execution_time [-34.159ms; -8.589ms] or [-17.181%; -4.320%]
  • 🟥 throughput [-7835.232op/s; -6713.357op/s] or [-7.967%; -6.826%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+308.783ms; +314.155ms] or [+153.229%; +155.895%]
  • 🟥 throughput [-53.156op/s; -47.939op/s] or [-9.564%; -8.625%]

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

  • 🟥 execution_time [+382.484ms; +383.635ms] or [+302.185%; +303.095%]
  • 🟩 throughput [+92.668op/s; +98.260op/s] or [+12.218%; +12.955%]

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

  • 🟥 execution_time [+393.899ms; +397.203ms] or [+348.586%; +351.510%]

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

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.528%; +27.540%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.976%; +9.987%]
  • 🟩 execution_time [-15.618ms; -11.428ms] or [-7.294%; -5.337%]
  • 🟩 throughput [+7412.745op/s; +10274.833op/s] or [+5.411%; +7.500%]

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

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

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

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.743%; +105.758%]
  • 🟥 throughput [-272077.238op/s; -268413.195op/s] or [-27.780%; -27.406%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.557%; +38.566%]
  • 🟩 execution_time [-26.369ms; -21.492ms] or [-11.760%; -9.584%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.288%; +105.304%]
  • 🟥 throughput [-151931.802op/s; -135590.231op/s] or [-21.830%; -19.482%]

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

  • 🟩 throughput [+10320.110op/s; +12951.302op/s] or [+8.221%; +10.317%]

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

  • 🟩 throughput [+458892.499op/s; +490196.611op/s] or [+15.301%; +16.345%]

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

  • 🟩 execution_time [-18.822ms; -14.488ms] or [-8.676%; -6.679%]
  • 🟩 throughput [+187730.748op/s; +240977.358op/s] or [+7.452%; +9.565%]

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

  • 🟥 execution_time [+299.941ms; +300.838ms] or [+149.870%; +150.318%]

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

  • 🟥 execution_time [+299.885ms; +303.823ms] or [+151.233%; +153.219%]

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

  • 🟥 execution_time [+299.237ms; +302.060ms] or [+150.732%; +152.154%]

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

  • 🟥 execution_time [+296.733ms; +297.833ms] or [+145.743%; +146.284%]

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

  • 🟥 execution_time [+295.390ms; +299.987ms] or [+144.405%; +146.653%]

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

  • 🟥 execution_time [+305.543ms; +306.844ms] or [+152.710%; +153.360%]

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

  • 🟥 execution_time [+23.505µs; +54.120µs] or [+5.391%; +12.413%]
  • 🟥 throughput [-254.214op/s; -122.674op/s] or [-11.052%; -5.333%]

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

  • 🟥 execution_time [+24.809µs; +48.420µs] or [+7.920%; +15.458%]
  • 🟥 throughput [-448.537op/s; -249.872op/s] or [-13.982%; -7.789%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+300.143ms; +300.907ms] or [+149.802%; +150.184%]

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

  • 🟥 execution_time [+405.236ms; +414.248ms] or [+440.306%; +450.098%]
  • 🟩 throughput [+932.709op/s; +1157.209op/s] or [+7.664%; +9.509%]

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

  • unstable execution_time [+199.734ms; +265.112ms] or [+151.656%; +201.297%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+263.068ms; +314.082ms] or [+120.956%; +144.412%]
  • 🟥 throughput [-493.389op/s; -453.016op/s] or [-44.706%; -41.048%]

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

  • unstable execution_time [+202.267ms; +335.522ms] or [+86.198%; +142.985%]
  • 🟥 throughput [-670.422op/s; -586.748op/s] or [-44.717%; -39.136%]

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

  • 🟥 execution_time [+335.839ms; +343.974ms] or [+200.870%; +205.736%]
  • 🟥 throughput [-387.088op/s; -351.259op/s] or [-26.952%; -24.458%]

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

  • 🟩 throughput [+28.245op/s; +41.783op/s] or [+5.576%; +8.248%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+301.507ms; +302.952ms] or [+151.833%; +152.561%]

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

  • 🟥 execution_time [+300.463ms; +301.949ms] or [+150.562%; +151.307%]

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

  • 🟥 execution_time [+300.567ms; +304.883ms] or [+150.992%; +153.160%]
  • 🟥 throughput [-95414.487op/s; -79017.486op/s] or [-20.099%; -16.645%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+302.141ms; +303.783ms] or [+151.725%; +152.550%]

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

  • 🟥 execution_time [+298.945ms; +301.910ms] or [+147.815%; +149.281%]

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

  • 🟥 execution_time [+299.953ms; +304.114ms] or [+152.029%; +154.138%]
  • 🟥 throughput [-102101.553op/s; -83632.037op/s] or [-22.048%; -18.060%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+300.787ms; +304.219ms] or [+150.968%; +152.691%]

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

  • 🟥 execution_time [+299.567ms; +304.012ms] or [+149.307%; +151.522%]
  • 🟩 throughput [+39489.358op/s; +46424.204op/s] or [+7.841%; +9.218%]

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

  • 🟥 execution_time [+301.349ms; +304.283ms] or [+149.918%; +151.378%]
  • 🟥 throughput [-61525.256op/s; -37851.773op/s] or [-14.563%; -8.960%]

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

  • 🟩 execution_time [-16.787ms; -13.105ms] or [-7.806%; -6.094%]

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

  • unstable execution_time [+17.110µs; +64.728µs] or [+4.226%; +15.988%]

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

  • 🟩 allocated_mem [-19.006KB; -18.982KB] or [-6.933%; -6.924%]
  • unstable execution_time [-21.188µs; +35.663µs] or [-4.188%; +7.049%]

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

  • unstable execution_time [-42.063µs; +17.642µs] or [-7.289%; +3.057%]

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

  • unstable execution_time [+9.150µs; +14.689µs] or [+21.627%; +34.721%]
  • 🟥 throughput [-6018.757op/s; -4042.973op/s] or [-25.337%; -17.020%]

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

  • unstable execution_time [-7.184µs; +1.426µs] or [-11.146%; +2.213%]
  • unstable throughput [-581.669op/s; +1123.520op/s] or [-3.569%; +6.893%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+302.129ms; +304.097ms] or [+152.713%; +153.708%]

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

  • 🟥 execution_time [+304.213ms; +307.359ms] or [+154.843%; +156.445%]

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

  • 🟥 execution_time [+300.330ms; +302.880ms] or [+150.352%; +151.629%]

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

  • 🟩 throughput [+40678.235op/s; +48969.684op/s] or [+7.700%; +9.269%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+299.675ms; +301.756ms] or [+149.361%; +150.398%]

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

  • 🟥 execution_time [+301.726ms; +303.830ms] or [+151.513%; +152.569%]

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

  • 🟥 execution_time [+302.785ms; +305.491ms] or [+153.553%; +154.925%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.573ms; +300.457ms] or [+149.429%; +149.869%]
  • 🟩 throughput [+65715909.397op/s; +66059765.874op/s] or [+47.858%; +48.109%]

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

  • 🟥 execution_time [+418.088ms; +422.224ms] or [+519.966%; +525.110%]

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

  • 🟥 execution_time [+300.322ms; +301.505ms] or [+149.794%; +150.384%]
  • 🟩 throughput [+17776204.559op/s; +18742627.201op/s] or [+7.874%; +8.302%]

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

  • 🟩 throughput [+72066.849op/s; +86781.126op/s] or [+6.729%; +8.102%]

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

  • 🟩 throughput [+48208.194op/s; +67370.377op/s] or [+5.580%; +7.798%]

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

  • 🟩 throughput [+82833.892op/s; +90209.082op/s] or [+8.227%; +8.959%]

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

  • 🟩 throughput [+52083.241op/s; +57550.179op/s] or [+9.457%; +10.450%]

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

  • 🟩 throughput [+86197.478op/s; +105063.139op/s] or [+9.630%; +11.738%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • 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 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.StartFinishSpan net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@chrisnas chrisnas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@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.

LGTM, thanks!

@andrewlock andrewlock added area:native-library Automatic instrumentation native C++ code (Datadog.Trace.ClrProfiler.Native) area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) identified-by:crashtracking labels Jul 6, 2026
@bouwkast
bouwkast marked this pull request as ready for review July 6, 2026 12:34
@bouwkast
bouwkast requested a review from a team as a code owner July 6, 2026 12:34
@bouwkast
bouwkast merged commit 7ce005f into master Jul 7, 2026
146 of 147 checks passed
@bouwkast
bouwkast deleted the steven/try-prevent-crash-module-unload branch July 7, 2026 13:46
@github-actions github-actions Bot added this to the vNext-v3 milestone Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:native-library Automatic instrumentation native C++ code (Datadog.Trace.ClrProfiler.Native) area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) identified-by:crashtracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants