Skip to content

Conversation

@andrewlock
Copy link
Member

Summary of changes

  • Adds a workaround for the version-conflict issue that occurs on app startup on Linux
  • Allow doing call target modification of version conflict dll
  • Fix a bug in CallTarget instrumentation where we get the assembly reference wrong

Reason for change

As part of app startup, on some linux distros, we shell out to stat to build the container tags/entity ID. We don't want to trace this Process.Start() call, so in #5280 we added a flag to skip instrumenting these calls. However, this fix relies on a [ThreadStatic] variable, and in version-conflict scenarios (2.x.x manual, 3.x.x automatic) we end up still instrumenting this call, which causes recursion in Tracer initialization and errors.

Note that since #7453 we don't do a process start at all, but that doesn't help in this situation, because it's the 2.x.x library that's doing the Process.Start()

Implementation details

  • Use standard call target instrumentation on the 2.x.x version of Datadog.Trace (i.e. version conflict only)
  • Hook the ProcessHelpers.StartWithDoNotTrace() method, and set the 3.x.x _doNotTrace variable for the duration of the method call
  • Tweak the Rejit handler so that we do rejit/call target the Datadog.Trace 2.x.x module (but not the 3.x.x module)
  • Fix a bug in the module builder which was incorrectly injecting a reference to the 2.x.x assembly instead of the 3.x.x assembly

Test coverage

We were already working around this issue in our VersionConflict tests, so I removed the workaround, confirmed that the test failed, then made the fix, and confirmed the tests pass again.

Other details

This will only help for customers using a manual version of 2.49.0+ (when we introduced the StartWithDoNotTrace() call). I think that's good enough support.

@andrewlock andrewlock requested review from a team as code owners November 6, 2025 15:56
@andrewlock andrewlock added the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label Nov 6, 2025
@andrewlock andrewlock requested a review from a team as a code owner November 6, 2025 15:56
@andrewlock andrewlock added area:native-library Automatic instrumentation native C++ code (Datadog.Trace.ClrProfiler.Native) identified-by:telemetry labels Nov 6, 2025
type_ref = mdTypeRefNil;
bool is_same_assembly = false;

if (metadata_.assemblyName == integration_definition.integration_type.assembly.name)
Copy link
Member Author

Choose a reason for hiding this comment

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

Previously we were only checking for "is this the right assembly" by checking the assembly name, but we should check the version too. This is obviously an issue in the version conflict scenario, but theoretically it's an issue in other cases where two versions of the assembly are loaded (I think)

// _may_ be present depending on the underlying host system (cgroup v1/v2).
// The "do not trace" helper that normally blocks tracing these spans doesn't
// work in version conflict scenarios.
SetEnvironmentVariable("DD_TRACE_Process_ENABLED", "0");
Copy link
Member Author

Choose a reason for hiding this comment

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

Prior to the fix, removing this caused some of the the tests to fail, because we generated process spans when we shouldn't on linux (on some distros only)

Copy link
Member Author

Choose a reason for hiding this comment

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

The changes here look worse than they are - if you ignore whitespace it makes more sense. The change is just to set perform_calltarget_instrumentation_on_version_conflict_assembly when we're in version conflict, and then to not skip rewriting in that case.

@datadog-datadog-prod-us1

This comment has been minimized.

@andrewlock andrewlock force-pushed the andrew/version-conflict-process branch from 76bd4c7 to 9638914 Compare November 7, 2025 10:07
@pr-commenter
Copy link

pr-commenter bot commented Nov 7, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7789 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.163
  • 3 benchmarks are slower, with geometric mean 1.808
  • 6 benchmarks have fewer allocations
  • 3 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 ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.7μs 58.8ns 338ns 0 0 0 5.51 KB
master StartStopWithChild netcoreapp3.1 14.3μs 71.8ns 337ns 0 0 0 5.68 KB
master StartStopWithChild net472 22μs 124ns 792ns 1 0.334 0.111 6.06 KB
#7789 StartStopWithChild net6.0 10.9μs 53.5ns 245ns 0 0 0 5.51 KB
#7789 StartStopWithChild netcoreapp3.1 13.5μs 68.7ns 299ns 0 0 0 5.69 KB
#7789 StartStopWithChild net472 21.8μs 116ns 658ns 0.883 0.221 0 6.08 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7789

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 952μs 280ns 1.08μs 0 0 0 2.72 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.03ms 170ns 660ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.2ms 77ns 278ns 0 0 0 3.35 KB
#7789 WriteAndFlushEnrichedTraces net6.0 963μs 315ns 1.18μs 0 0 0 2.71 KB
#7789 WriteAndFlushEnrichedTraces netcoreapp3.1 1.04ms 51.1ns 191ns 0 0 0 2.7 KB
#7789 WriteAndFlushEnrichedTraces net472 1.19ms 89.3ns 346ns 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.09μs 6.29ns 50.3ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.45μs 8.23ns 57ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.05μs 0.276ns 1.03ns 0.191 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 6.99μs 38.6ns 222ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 8.98μs 22.8ns 88.3ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.64μs 6.04ns 23.4ns 0.729 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 334ns 0.361ns 1.4ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 400ns 1.93ns 8.2ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 296ns 0.0186ns 0.0644ns 0.0434 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.33μs 4.04ns 15.6ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.72μs 36.4ns 150ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.71μs 2.01ns 7.52ns 0.574 0 0 3.8 KB
#7789 AllCycleSimpleBody net6.0 1.09μs 6.3ns 47.2ns 0 0 0 1.22 KB
#7789 AllCycleSimpleBody netcoreapp3.1 1.45μs 7.03ns 28.1ns 0 0 0 1.2 KB
#7789 AllCycleSimpleBody net472 1μs 0.776ns 3ns 0.195 0 0 1.23 KB
#7789 AllCycleMoreComplexBody net6.0 7.01μs 38.8ns 252ns 0 0 0 4.72 KB
#7789 AllCycleMoreComplexBody netcoreapp3.1 9.02μs 44.4ns 198ns 0 0 0 4.62 KB
#7789 AllCycleMoreComplexBody net472 7.64μs 2ns 7.23ns 0.725 0 0 4.74 KB
#7789 ObjectExtractorSimpleBody net6.0 317ns 1.57ns 6.84ns 0 0 0 280 B
#7789 ObjectExtractorSimpleBody netcoreapp3.1 419ns 2.4ns 16.8ns 0 0 0 272 B
#7789 ObjectExtractorSimpleBody net472 306ns 0.0119ns 0.0446ns 0.0446 0 0 281 B
#7789 ObjectExtractorMoreComplexBody net6.0 6.36μs 27.8ns 108ns 0 0 0 3.78 KB
#7789 ObjectExtractorMoreComplexBody netcoreapp3.1 7.78μs 34.8ns 130ns 0 0 0 3.69 KB
#7789 ObjectExtractorMoreComplexBody net472 6.67μs 1.07ns 3.86ns 0.601 0 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 77.4μs 32.7ns 118ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 97.8μs 36.1ns 140ns 0 0 0 32.4 KB
master EncodeArgs net472 110μs 12.1ns 46.8ns 4.96 0 0 32.51 KB
master EncodeLegacyArgs net6.0 146μs 194ns 752ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 197μs 168ns 650ns 0 0 0 2.15 KB
master EncodeLegacyArgs net472 263μs 212ns 735ns 0 0 0 2.16 KB
#7789 EncodeArgs net6.0 77.2μs 232ns 867ns 0 0 0 32.4 KB
#7789 EncodeArgs netcoreapp3.1 96.5μs 343ns 1.33μs 0 0 0 32.4 KB
#7789 EncodeArgs net472 109μs 11.5ns 43ns 4.91 0 0 32.51 KB
#7789 EncodeLegacyArgs net6.0 147μs 24.2ns 93.8ns 0 0 0 2.15 KB
#7789 EncodeLegacyArgs netcoreapp3.1 198μs 154ns 595ns 0 0 0 2.14 KB
#7789 EncodeLegacyArgs net472 264μs 61.2ns 237ns 0 0 0 2.17 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #7789

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1 2.400 298,978.50 717,406.33
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1 2.104 412,767.50 868,585.56

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 406μs 111ns 400ns 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 413μs 229ns 885ns 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 447μs 101ns 391ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 294μs 118ns 457ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 299μs 161ns 556ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 319μs 49.9ns 180ns 0 0 0 2.28 KB
#7789 RunWafRealisticBenchmark net6.0 391μs 52.3ns 188ns 0 0 0 4.55 KB
#7789 RunWafRealisticBenchmark netcoreapp3.1 788μs 16.4μs 162μs 0 0 0 4.48 KB
#7789 RunWafRealisticBenchmark net472 426μs 43.8ns 169ns 0 0 0 4.66 KB
#7789 RunWafRealisticBenchmarkWithAttack net6.0 286μs 40.4ns 146ns 0 0 0 2.24 KB
#7789 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 670μs 13.1μs 131μs 0 0 0 2.22 KB
#7789 RunWafRealisticBenchmarkWithAttack net472 311μs 43.1ns 161ns 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 62.2μs 87.6ns 303ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 71.8μs 76.2ns 285ns 0 0 0 17.42 KB
master SendRequest net472 0.0175ns 0.00341ns 0.0132ns 0 0 0 0 b
#7789 SendRequest net6.0 60.1μs 62.4ns 234ns 0 0 0 14.52 KB
#7789 SendRequest netcoreapp3.1 73μs 204ns 788ns 0 0 0 17.42 KB
#7789 SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7789

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 2 B 4 B 2 B 100.00%

Fewer allocations 🎉 in #7789

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net472 73 B 0 b -73 B -100.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1 1 B 0 b -1 B -100.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472 47 B 0 b -47 B -100.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.86ms 3.83μs 14.9μs 0 0 0 640 KB
master OriginalCharSlice netcoreapp3.1 2.05ms 4.47μs 16.1μs 0 0 0 640 KB
master OriginalCharSlice net472 2.69ms 2.18μs 8.46μs 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.44ms 1.36μs 5.28μs 0 0 0 2 B
master OptimizedCharSlice netcoreapp3.1 1.65ms 264ns 989ns 0 0 0 1 B
master OptimizedCharSlice net472 1.9ms 298ns 1.12μs 0 0 0 73 B
master OptimizedCharSliceWithPool net6.0 820μs 66.1ns 256ns 0 0 0 2 B
master OptimizedCharSliceWithPool netcoreapp3.1 811μs 61.5ns 238ns 0 0 0 1 B
master OptimizedCharSliceWithPool net472 1.19ms 98.4ns 381ns 0 0 0 47 B
#7789 OriginalCharSlice net6.0 1.94ms 4.36μs 16.9μs 0 0 0 640.01 KB
#7789 OriginalCharSlice netcoreapp3.1 2.1ms 7.46μs 27.9μs 0 0 0 640 KB
#7789 OriginalCharSlice net472 2.59ms 546ns 2.11μs 100 0 0 641.95 KB
#7789 OptimizedCharSlice net6.0 1.37ms 288ns 1.08μs 0 0 0 4 B
#7789 OptimizedCharSlice netcoreapp3.1 1.68ms 1.96μs 7.59μs 0 0 0 1 B
#7789 OptimizedCharSlice net472 2.02ms 268ns 1.04μs 0 0 0 0 b
#7789 OptimizedCharSliceWithPool net6.0 814μs 118ns 455ns 0 0 0 2 B
#7789 OptimizedCharSliceWithPool netcoreapp3.1 809μs 58.6ns 227ns 0 0 0 0 b
#7789 OptimizedCharSliceWithPool net472 1.13ms 122ns 474ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Faster 🎉 More allocations ⚠️

Faster 🎉 in #7789

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 1.163 746,976.88 642,380.83

More allocations ⚠️ in #7789

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 41.76 KB 41.98 KB 215 B 0.51%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 747μs 1.15μs 4.45μs 0 0 0 41.57 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 772μs 5.49μs 54.9μs 0 0 0 41.76 KB
master WriteAndFlushEnrichedTraces net472 931μs 4.28μs 16.6μs 8.33 0 0 55.98 KB
#7789 WriteAndFlushEnrichedTraces net6.0 642μs 547ns 2.12μs 0 0 0 41.66 KB
#7789 WriteAndFlushEnrichedTraces netcoreapp3.1 721μs 1.8μs 6.97μs 0 0 0 41.98 KB
#7789 WriteAndFlushEnrichedTraces net472 955μs 2.99μs 11.6μs 8.33 0 0 56.19 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 9.66ns 44.3ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.62μs 12.6ns 53.6ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.87μs 3.83ns 14.3ns 0.156 0.0142 0 987 B
#7789 ExecuteNonQuery net6.0 1.87μs 5.92ns 22.9ns 0 0 0 1.02 KB
#7789 ExecuteNonQuery netcoreapp3.1 2.63μs 9.06ns 35.1ns 0 0 0 1.02 KB
#7789 ExecuteNonQuery net472 2.9μs 15.4ns 77.1ns 0.155 0.0141 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.73μs 1.46ns 5.65ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.18μs 11.1ns 49.8ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.53μs 1.9ns 6.84ns 0.158 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.84μs 7.43ns 28.8ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.36μs 8.34ns 32.3ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.63μs 0.776ns 2.8ns 0.163 0 0 1.1 KB
#7789 CallElasticsearch net6.0 1.73μs 8.55ns 37.3ns 0 0 0 1.03 KB
#7789 CallElasticsearch netcoreapp3.1 2.32μs 11.3ns 48.1ns 0 0 0 1.03 KB
#7789 CallElasticsearch net472 3.42μs 1.36ns 5.08ns 0.155 0 0 1.04 KB
#7789 CallElasticsearchAsync net6.0 1.86μs 9.78ns 47.9ns 0 0 0 1.01 KB
#7789 CallElasticsearchAsync netcoreapp3.1 2.45μs 10.5ns 40.7ns 0 0 0 1.08 KB
#7789 CallElasticsearchAsync net472 3.55μs 3.58ns 13.9ns 0.16 0 0 1.1 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.87μs 4.01ns 15.5ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.51μs 8.35ns 32.3ns 0 0 0 952 B
master ExecuteAsync net472 2.58μs 1.31ns 4.89ns 0.141 0 0 915 B
#7789 ExecuteAsync net6.0 1.89μs 9.59ns 41.8ns 0 0 0 952 B
#7789 ExecuteAsync netcoreapp3.1 2.52μs 0.929ns 3.48ns 0 0 0 952 B
#7789 ExecuteAsync net472 2.54μs 4.4ns 17ns 0.141 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 7.19μs 3.43ns 12.4ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.67μs 19.4ns 75ns 0 0 0 2.9 KB
master SendAsync net472 12.5μs 8.63ns 33.4ns 0.497 0 0 3.18 KB
#7789 SendAsync net6.0 6.85μs 6.96ns 26.1ns 0 0 0 2.36 KB
#7789 SendAsync netcoreapp3.1 8.53μs 28ns 101ns 0 0 0 2.9 KB
#7789 SendAsync net472 11.9μs 9.15ns 31.7ns 0.476 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #7789

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 1.171 453,550.00 531,200.00

More allocations ⚠️ in #7789

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 275.24 KB 278.53 KB 3.29 KB 1.19%

Fewer allocations 🎉 in #7789

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 45.32 KB 43.51 KB -1.81 KB -3.99%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 274.41 KB 256.76 KB -17.65 KB -6.43%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 44.9μs 314ns 2.93μs 0 0 0 45.32 KB
master StringConcatBenchmark netcoreapp3.1 51.9μs 506ns 4.83μs 0 0 0 42.9 KB
master StringConcatBenchmark net472 56.5μs 270ns 1.05μs 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 470μs 1.99μs 7.18μs 0 0 0 274.41 KB
master StringConcatAspectBenchmark netcoreapp3.1 468μs 5.37μs 52.3μs 0 0 0 275.95 KB
master StringConcatAspectBenchmark net472 417μs 2.31μs 14.4μs 0 0 0 275.24 KB
#7789 StringConcatBenchmark net6.0 42.3μs 140ns 558ns 0 0 0 43.51 KB
#7789 StringConcatBenchmark netcoreapp3.1 51.5μs 301ns 2.5μs 0 0 0 43.09 KB
#7789 StringConcatBenchmark net472 57.8μs 116ns 418ns 0 0 0 57.34 KB
#7789 StringConcatAspectBenchmark net6.0 458μs 2.1μs 8.13μs 0 0 0 256.76 KB
#7789 StringConcatAspectBenchmark netcoreapp3.1 533μs 2.06μs 7.44μs 0 0 0 274.74 KB
#7789 StringConcatAspectBenchmark net472 406μs 2.31μs 17μs 0 0 0 278.53 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.67μs 13.5ns 58.8ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.6μs 17.5ns 74.4ns 0 0 0 1.7 KB
master EnrichedLog net472 4.02μs 4.38ns 16.4ns 0.241 0 0 1.64 KB
#7789 EnrichedLog net6.0 2.63μs 1.56ns 5.85ns 0 0 0 1.7 KB
#7789 EnrichedLog netcoreapp3.1 3.72μs 16.9ns 67.6ns 0 0 0 1.7 KB
#7789 EnrichedLog net472 4μs 4.26ns 16.5ns 0.259 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 121μs 64.4ns 241ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 128μs 244ns 944ns 0 0 0 4.31 KB
master EnrichedLog net472 167μs 105ns 406ns 0 0 0 4.52 KB
#7789 EnrichedLog net6.0 125μs 549ns 2.05μs 0 0 0 4.31 KB
#7789 EnrichedLog netcoreapp3.1 132μs 387ns 1.4μs 0 0 0 4.31 KB
#7789 EnrichedLog net472 173μs 407ns 1.58μs 0 0 0 4.52 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 5.13μs 7.62ns 28.5ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.77μs 16.5ns 63.7ns 0 0 0 2.26 KB
master EnrichedLog net472 7.49μs 5.68ns 22ns 0.299 0 0 2.08 KB
#7789 EnrichedLog net6.0 5.15μs 20.6ns 77.1ns 0 0 0 2.26 KB
#7789 EnrichedLog netcoreapp3.1 7.1μs 2.42ns 9.05ns 0 0 0 2.26 KB
#7789 EnrichedLog net472 7.63μs 9.33ns 36.1ns 0.304 0 0 2.08 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.93μs 10ns 49.1ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.65μs 12.4ns 48.2ns 0 0 0 1.2 KB
master SendReceive net472 3.05μs 1.37ns 5.12ns 0.182 0 0 1.2 KB
#7789 SendReceive net6.0 1.94μs 3.7ns 13.3ns 0 0 0 1.2 KB
#7789 SendReceive netcoreapp3.1 2.57μs 13.1ns 60.2ns 0 0 0 1.2 KB
#7789 SendReceive net472 3.13μs 10.8ns 41.7ns 0.188 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.25μs 16.5ns 59.5ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.64μs 11.1ns 42.9ns 0 0 0 1.63 KB
master EnrichedLog net472 6.55μs 5.53ns 21.4ns 0.293 0 0 2.03 KB
#7789 EnrichedLog net6.0 4.31μs 10.1ns 39.2ns 0 0 0 1.58 KB
#7789 EnrichedLog netcoreapp3.1 5.66μs 17.3ns 67ns 0 0 0 1.63 KB
#7789 EnrichedLog net472 6.7μs 7.47ns 28.9ns 0.303 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 785ns 0.322ns 1.25ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 966ns 4.8ns 22.5ns 0 0 0 576 B
master StartFinishSpan net472 920ns 0.57ns 2.21ns 0.0878 0 0 578 B
master StartFinishScope net6.0 924ns 1.26ns 4.86ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.24μs 5.83ns 22.6ns 0 0 0 696 B
master StartFinishScope net472 1.11μs 1.01ns 3.63ns 0.101 0 0 658 B
#7789 StartFinishSpan net6.0 781ns 3.71ns 15.3ns 0 0 0 576 B
#7789 StartFinishSpan netcoreapp3.1 965ns 5.1ns 27ns 0 0 0 576 B
#7789 StartFinishSpan net472 927ns 0.793ns 3.07ns 0.0883 0 0 578 B
#7789 StartFinishScope net6.0 909ns 5.05ns 29.9ns 0 0 0 696 B
#7789 StartFinishScope netcoreapp3.1 1.24μs 6.11ns 25.9ns 0 0 0 696 B
#7789 StartFinishScope net472 1.15μs 1.32ns 5.1ns 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.07μs 5.35ns 22.7ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.42μs 4.5ns 17.4ns 0 0 0 696 B
master RunOnMethodBegin net472 1.51μs 1.53ns 5.71ns 0.0981 0 0 658 B
#7789 RunOnMethodBegin net6.0 1.05μs 5.24ns 24.6ns 0 0 0 696 B
#7789 RunOnMethodBegin netcoreapp3.1 1.44μs 5.36ns 20.8ns 0 0 0 696 B
#7789 RunOnMethodBegin net472 1.49μs 0.917ns 3.55ns 0.105 0 0 658 B

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

dd-trace-dotnet-ci-bot bot commented Nov 7, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7789) 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.48 ± (74.31 - 74.88) ms75.20 ± (75.02 - 75.88) ms+1.0%✅⬆️
.NET Framework 4.8 - Bailout
duration78.90 ± (78.67 - 79.39) ms79.06 ± (79.06 - 79.81) ms+0.2%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1103.59 ± (1107.85 - 1120.05) ms1094.05 ± (1094.71 - 1103.46) ms-0.9%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.96 ± (22.88 - 23.03) ms22.84 ± (22.77 - 22.91) ms-0.5%
process.time_to_main_ms86.93 ± (86.55 - 87.30) ms86.28 ± (85.92 - 86.64) ms-0.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.91 ± (10.91 - 10.92) MB10.88 ± (10.87 - 10.88) MB-0.3%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.82 ± (22.75 - 22.88) ms22.64 ± (22.58 - 22.69) ms-0.8%
process.time_to_main_ms89.15 ± (88.80 - 89.50) ms87.65 ± (87.27 - 88.04) ms-1.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.96 ± (10.96 - 10.97) MB10.92 ± (10.92 - 10.92) MB-0.4%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms217.99 ± (216.69 - 219.29) ms220.67 ± (219.30 - 222.03) ms+1.2%✅⬆️
process.time_to_main_ms544.29 ± (543.13 - 545.46) ms544.07 ± (542.97 - 545.16) ms-0.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed52.71 ± (52.69 - 52.73) MB52.50 ± (52.48 - 52.51) MB-0.4%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.5%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms21.61 ± (21.55 - 21.67) ms21.49 ± (21.44 - 21.54) ms-0.6%
process.time_to_main_ms75.35 ± (75.03 - 75.67) ms74.67 ± (74.37 - 74.97) ms-0.9%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.61 ± (10.61 - 10.61) MB10.61 ± (10.60 - 10.61) MB-0.0%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.43 ± (21.38 - 21.47) ms21.47 ± (21.41 - 21.53) ms+0.2%✅⬆️
process.time_to_main_ms75.78 ± (75.47 - 76.10) ms75.50 ± (75.20 - 75.80) ms-0.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.66 ± (10.65 - 10.66) MB10.63 ± (10.63 - 10.63) MB-0.2%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms205.79 ± (204.17 - 207.41) ms205.08 ± (203.55 - 206.60) ms-0.3%
process.time_to_main_ms511.24 ± (510.10 - 512.38) ms503.84 ± (502.95 - 504.72) ms-1.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed51.78 ± (51.74 - 51.82) MB51.63 ± (51.59 - 51.66) MB-0.3%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.77 ± (19.70 - 19.83) ms19.73 ± (19.68 - 19.79) ms-0.2%
process.time_to_main_ms73.96 ± (73.64 - 74.28) ms74.18 ± (73.87 - 74.49) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.65 - 7.66) MB7.62 ± (7.61 - 7.63) MB-0.5%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.68 ± (19.63 - 19.73) ms19.64 ± (19.59 - 19.70) ms-0.2%
process.time_to_main_ms74.67 ± (74.39 - 74.95) ms75.01 ± (74.76 - 75.27) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.71 ± (7.70 - 7.71) MB7.68 ± (7.67 - 7.69) MB-0.4%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms189.44 ± (188.40 - 190.47) ms188.28 ± (187.31 - 189.24) ms-0.6%
process.time_to_main_ms488.45 ± (487.28 - 489.62) ms480.99 ± (480.00 - 481.98) ms-1.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed39.12 ± (39.08 - 39.15) MB38.78 ± (38.74 - 38.82) MB-0.9%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.0%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration192.56 ± (192.48 - 193.30) ms192.84 ± (192.72 - 193.36) ms+0.1%✅⬆️
.NET Framework 4.8 - Bailout
duration195.81 ± (195.58 - 196.13) ms197.16 ± (196.98 - 197.52) ms+0.7%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1152.62 ± (1155.92 - 1164.24) ms1163.08 ± (1166.51 - 1175.94) ms+0.9%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms187.37 ± (187.04 - 187.69) ms188.15 ± (187.73 - 188.57) ms+0.4%✅⬆️
process.time_to_main_ms80.51 ± (80.31 - 80.72) ms81.04 ± (80.83 - 81.25) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.03 ± (16.01 - 16.06) MB16.13 ± (16.09 - 16.16) MB+0.6%✅⬆️
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (19 - 20)+0.1%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms187.00 ± (186.63 - 187.36) ms187.80 ± (187.51 - 188.08) ms+0.4%✅⬆️
process.time_to_main_ms81.90 ± (81.73 - 82.06) ms82.02 ± (81.87 - 82.17) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.11 ± (16.09 - 16.14) MB16.18 ± (16.14 - 16.21) MB+0.4%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)+0.8%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms396.00 ± (393.63 - 398.37) ms395.53 ± (393.06 - 398.00) ms-0.1%
process.time_to_main_ms519.83 ± (519.17 - 520.50) ms516.45 ± (515.84 - 517.07) ms-0.6%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed63.41 ± (63.28 - 63.55) MB63.06 ± (62.91 - 63.21) MB-0.6%
runtime.dotnet.threads.count29 ± (29 - 30)29 ± (29 - 29)-0.1%
.NET 6 - Baseline
process.internal_duration_ms191.20 ± (190.84 - 191.56) ms192.18 ± (191.88 - 192.48) ms+0.5%✅⬆️
process.time_to_main_ms69.64 ± (69.47 - 69.81) ms70.16 ± (69.98 - 70.34) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed15.94 ± (15.79 - 16.08) MB16.05 ± (15.90 - 16.20) MB+0.7%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.6%
.NET 6 - Bailout
process.internal_duration_ms190.48 ± (190.15 - 190.81) ms192.37 ± (191.91 - 192.83) ms+1.0%✅⬆️
process.time_to_main_ms70.60 ± (70.48 - 70.71) ms71.58 ± (71.41 - 71.75) ms+1.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed15.85 ± (15.69 - 16.01) MB16.46 ± (16.41 - 16.51) MB+3.8%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)20 ± (20 - 20)+5.3%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms409.46 ± (406.42 - 412.50) ms415.32 ± (411.86 - 418.77) ms+1.4%✅⬆️
process.time_to_main_ms486.65 ± (486.07 - 487.24) ms484.52 ± (483.97 - 485.07) ms-0.4%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.93 ± (61.77 - 62.09) MB62.05 ± (61.91 - 62.19) MB+0.2%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.1%
.NET 8 - Baseline
process.internal_duration_ms189.08 ± (188.85 - 189.31) ms191.25 ± (190.86 - 191.64) ms+1.1%✅⬆️
process.time_to_main_ms69.06 ± (68.90 - 69.21) ms69.37 ± (69.19 - 69.54) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.74 ± (11.71 - 11.77) MB11.74 ± (11.70 - 11.77) MB-0.0%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.2%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms188.67 ± (188.33 - 189.00) ms190.15 ± (189.79 - 190.51) ms+0.8%✅⬆️
process.time_to_main_ms70.33 ± (70.20 - 70.46) ms70.31 ± (70.17 - 70.45) ms-0.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.66 ± (11.58 - 11.75) MB11.84 ± (11.81 - 11.87) MB+1.5%✅⬆️
runtime.dotnet.threads.count19 ± (18 - 19)19 ± (19 - 19)+2.3%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms357.31 ± (355.99 - 358.64) ms360.02 ± (358.59 - 361.44) ms+0.8%✅⬆️
process.time_to_main_ms463.88 ± (463.35 - 464.40) ms459.20 ± (458.60 - 459.80) ms-1.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.50 ± (50.45 - 50.54) MB50.25 ± (50.21 - 50.29) MB-0.5%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+1.2%✅⬆️
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 (7789) - mean (75ms)  : 69, 82
    master - mean (75ms)  : 70, 79

    section Bailout
    This PR (7789) - mean (79ms)  : 74, 85
    master - mean (79ms)  : 73, 85

    section CallTarget+Inlining+NGEN
    This PR (7789) - mean (1,099ms)  : 1037, 1161
    master - mean (1,114ms)  : 1019, 1208

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

    section Bailout
    This PR (7789) - mean (118ms)  : 109, 126
    master - mean (120ms)  : 112, 128

    section CallTarget+Inlining+NGEN
    This PR (7789) - mean (803ms)  : 767, 839
    master - mean (801ms)  : 766, 835

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

    section Bailout
    This PR (7789) - mean (104ms)  : 97, 111
    master - mean (104ms)  : 96, 112

    section CallTarget+Inlining+NGEN
    This PR (7789) - mean (740ms)  : 703, 776
    master - mean (757ms)  : 696, 817

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

    section Bailout
    This PR (7789) - mean (103ms)  : 97, 109
    master - mean (103ms)  : 96, 110

    section CallTarget+Inlining+NGEN
    This PR (7789) - mean (700ms)  : 668, 732
    master - mean (717ms)  : 681, 753

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 (7789) - mean (193ms)  : 190, 196
    master - mean (193ms)  : 189, 197

    section Bailout
    This PR (7789) - mean (197ms)  : 195, 200
    master - mean (196ms)  : 193, 198

    section CallTarget+Inlining+NGEN
    This PR (7789) - mean (1,171ms)  : 1104, 1238
    master - mean (1,160ms)  : 1100, 1220

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 (7789) - mean (277ms)  : 272, 283
    master - mean (276ms)  : 272, 281

    section Bailout
    This PR (7789) - mean (278ms)  : 274, 282
    master - mean (277ms)  : 272, 281

    section CallTarget+Inlining+NGEN
    This PR (7789) - mean (953ms)  : 907, 1000
    master - mean (951ms)  : 907, 995

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7789) - mean (271ms)  : 265, 276
    master - mean (269ms)  : 264, 275

    section Bailout
    This PR (7789) - mean (272ms)  : 266, 279
    master - mean (269ms)  : 265, 273

    section CallTarget+Inlining+NGEN
    This PR (7789) - mean (930ms)  : 880, 981
    master - mean (925ms)  : 876, 975

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

    section Bailout
    This PR (7789) - mean (270ms)  : 265, 276
    master - mean (269ms)  : 264, 273

    section CallTarget+Inlining+NGEN
    This PR (7789) - mean (850ms)  : 828, 873
    master - mean (853ms)  : 836, 869

Loading

@andrewlock andrewlock force-pushed the andrew/version-conflict-process branch from 9638914 to b5a39c5 Compare November 7, 2025 12:24
// Name matches, now check the version, in case we have multiple versions of the assembly loaded
// TODO: we should already have this data, so should probably just pass that data through,
// but it's a bit of a pain, to thread that needle right now
const auto current_assembly_metadata = GetAssemblyImportMetadata(assembly_import_);
Copy link
Member

Choose a reason for hiding this comment

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

We use const auto& everywhere else we call GetAssemblyImportMetadata() to avoid making a copy.

Suggested change
const auto current_assembly_metadata = GetAssemblyImportMetadata(assembly_import_);
const auto& current_assembly_metadata = GetAssemblyImportMetadata(assembly_import_);

/// Used to override the "do not trace" state for the current thread's call to <see cref="Process.Start()"/>.
/// Prefer using <see cref="StartWithDoNotTrace"/> - this should only be used to work around version conflict scenarios
/// </summary>
public static bool ForceDoNotTrace(bool doNotTrace) => _doNotTrace = doNotTrace;
Copy link
Member

Choose a reason for hiding this comment

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

This just returns the value of the doNotTrace parameter, which seems useless. And it looks like the return value is never used, anyway?

Suggested change
public static bool ForceDoNotTrace(bool doNotTrace) => _doNotTrace = doNotTrace;
public static void ForceDoNotTrace(bool doNotTrace) => _doNotTrace = doNotTrace;

MethodName = "StartWithDoNotTrace",
ReturnTypeName = ClrNames.Process,
ParameterTypeNames = ["System.Diagnostics.ProcessStartInfo", ClrNames.Bool],
MinimumVersion = "2.49.0",
Copy link
Member

Choose a reason for hiding this comment

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

Consider adding a comments to explain why versions 2.49.0 <= x <= 2.*.*

From your PR description:

This will only help for customers using a manual version of 2.49.0+ (when we introduced the StartWithDoNotTrace() call).

@lucaspimentel lucaspimentel requested a review from a team November 7, 2025 20:26
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:telemetry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants