Skip to content

Fix IAST strings deferred enumerable#8556

Merged
e-n-0 merged 7 commits into
masterfrom
flavien.darche/iast-fix-deferred-enums
May 5, 2026
Merged

Fix IAST strings deferred enumerable#8556
e-n-0 merged 7 commits into
masterfrom
flavien.darche/iast-fix-deferred-enums

Conversation

@e-n-0

@e-n-0 e-n-0 commented May 4, 2026

Copy link
Copy Markdown
Member

Summary of changes

  • Materialize deferred enumerable inputs once in IAST aspects for string.Join, string.Concat, and StringBuilder.AppendJoin.
  • Reuse the materialized values for both the original framework call and IAST taint propagation.
  • Add regression coverage for deferred enumerable inputs to ensure they are not enumerated more than once.

Reason for change

IAST propagation was re-enumerating deferred IEnumerable<T> inputs after the original .NET API had already consumed them.
For deferred sequences with side effects, this changed application behavior.

We got case where when using SqlKata/Npgsql, the second enumeration duplicated query compiler side effects and misaligned SQL bindings.

Implementation details

  • Added materialization helpers that preserve null argument behavior and avoid extra allocation when the input is already an array.
  • Updated affected enumerable overloads to call the framework API with the materialized array.
  • Passed the same materialized array into IAST propagation, preventing IAST from re-running user iterator code.
  • Kept array overloads unchanged because arrays are already stable, materialized inputs.

Test coverage

  • Added deferred enumerable regression tests for string.Join, string.Concat, and StringBuilder.AppendJoin.
  • Verified each affected enumerable is evaluated exactly once.

https://datadoghq.atlassian.net/browse/APPSEC-63121

@e-n-0
e-n-0 requested a review from a team as a code owner May 4, 2026 15:36
@e-n-0
e-n-0 marked this pull request as draft May 4, 2026 15:36
@e-n-0 e-n-0 self-assigned this May 4, 2026
@pr-commenter

pr-commenter Bot commented May 5, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-05-05 14:43:00

Comparing candidate commit 12d75eb in PR branch flavien.darche/iast-fix-deferred-enums with baseline commit b7244f5 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 [+9904.466op/s; +12077.680op/s] or [+8.325%; +10.152%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+307.207ms; +311.949ms] or [+152.447%; +154.800%]
  • 🟥 throughput [-47.587op/s; -43.551op/s] or [-8.562%; -7.836%]

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

  • 🟥 execution_time [+377.428ms; +380.208ms] or [+298.191%; +300.388%]
  • 🟩 throughput [+94.091op/s; +98.645op/s] or [+12.406%; +13.006%]

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

  • 🟥 execution_time [+394.914ms; +396.546ms] or [+349.484%; +350.928%]

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.986ms; -11.769ms] or [-7.466%; -5.497%]

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 [-266015.295op/s; -262744.641op/s] or [-27.161%; -26.828%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.558%; +38.566%]
  • 🟩 execution_time [-26.083ms; -21.239ms] or [-11.632%; -9.472%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.292%; +105.304%]
  • 🟥 throughput [-142179.803op/s; -126072.481op/s] or [-20.429%; -18.114%]

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

  • 🟩 throughput [+7945.720op/s; +10877.943op/s] or [+5.056%; +6.921%]

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

  • 🟩 throughput [+323521.596op/s; +355603.311op/s] or [+10.788%; +11.857%]

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

  • 🟩 execution_time [-19.117ms; -14.745ms] or [-8.812%; -6.797%]
  • 🟩 throughput [+188112.652op/s; +242422.089op/s] or [+7.467%; +9.622%]

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

  • 🟥 execution_time [+299.617ms; +300.162ms] or [+149.708%; +149.981%]

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

  • 🟥 execution_time [+300.209ms; +303.431ms] or [+151.396%; +153.021%]

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

  • 🟥 execution_time [+300.107ms; +302.857ms] or [+151.171%; +152.556%]

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

  • 🟥 execution_time [+297.196ms; +298.005ms] or [+145.971%; +146.368%]

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

  • 🟥 execution_time [+298.049ms; +301.189ms] or [+145.705%; +147.240%]

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

  • 🟥 execution_time [+300.256ms; +301.376ms] or [+150.067%; +150.628%]

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

  • 🟥 allocated_mem [+24.624KB; +24.625KB] or [+540.967%; +540.996%]

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

  • 🟥 execution_time [+23.016µs; +46.585µs] or [+7.348%; +14.872%]
  • 🟥 throughput [-433.426op/s; -235.078op/s] or [-13.511%; -7.328%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.728ms; +300.420ms] or [+149.595%; +149.940%]

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

  • unstable execution_time [+370.742ms; +406.677ms] or [+402.826%; +441.871%]
  • 🟩 throughput [+1149.642op/s; +1281.558op/s] or [+9.447%; +10.531%]

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

  • 🟥 execution_time [+370.764ms; +374.516ms] or [+281.517%; +284.366%]
  • 🟩 throughput [+709.533op/s; +909.741op/s] or [+6.869%; +8.807%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+274.871ms; +315.791ms] or [+126.383%; +145.198%]
  • 🟥 throughput [-540.615op/s; -501.173op/s] or [-48.985%; -45.411%]

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

  • unstable execution_time [+179.290ms; +316.268ms] or [+76.406%; +134.780%]
  • 🟥 throughput [-672.084op/s; -588.527op/s] or [-44.828%; -39.255%]

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

  • 🟥 execution_time [+335.440ms; +343.523ms] or [+200.632%; +205.467%]
  • 🟥 throughput [-407.850op/s; -372.286op/s] or [-28.398%; -25.922%]

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

  • 🟩 execution_time [-155.161µs; -121.226µs] or [-7.860%; -6.141%]
  • 🟩 throughput [+34.744op/s; +43.611op/s] or [+6.859%; +8.609%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+304.110ms; +305.860ms] or [+153.144%; +154.025%]

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

  • 🟥 execution_time [+301.593ms; +303.220ms] or [+151.129%; +151.944%]

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

  • 🟥 execution_time [+300.614ms; +305.452ms] or [+151.016%; +153.446%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+303.063ms; +304.649ms] or [+152.188%; +152.984%]

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

  • 🟥 execution_time [+298.633ms; +300.654ms] or [+147.661%; +148.660%]

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

  • 🟥 execution_time [+304.111ms; +307.620ms] or [+154.137%; +155.916%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+300.740ms; +302.211ms] or [+150.945%; +151.683%]

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

  • 🟥 execution_time [+299.786ms; +306.793ms] or [+149.416%; +152.908%]
  • 🟩 throughput [+50941.107op/s; +59187.988op/s] or [+10.115%; +11.753%]

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

  • 🟥 execution_time [+301.491ms; +304.001ms] or [+149.989%; +151.238%]

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

  • 🟩 execution_time [-16.157ms; -12.519ms] or [-7.513%; -5.822%]

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

  • unstable execution_time [+9.040µs; +50.289µs] or [+2.233%; +12.422%]

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

  • 🟩 allocated_mem [-20.561KB; -20.541KB] or [-7.500%; -7.493%]
  • unstable execution_time [-51.638µs; +0.175µs] or [-10.206%; +0.034%]

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

  • unstable execution_time [+8.170µs; +12.793µs] or [+19.311%; +30.239%]
  • 🟥 throughput [-5397.463op/s; -3528.350op/s] or [-22.722%; -14.853%]

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

  • unstable execution_time [-12.613µs; -5.175µs] or [-19.568%; -8.029%]
  • 🟩 throughput [+1306.387op/s; +2894.803op/s] or [+8.015%; +17.761%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+303.073ms; +304.064ms] or [+153.190%; +153.691%]

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

  • 🟥 execution_time [+302.646ms; +305.050ms] or [+154.046%; +155.270%]

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

  • 🟥 execution_time [+299.644ms; +301.801ms] or [+150.009%; +151.089%]

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

  • 🟩 throughput [+33715.856op/s; +36653.677op/s] or [+6.382%; +6.938%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+299.781ms; +301.393ms] or [+149.414%; +150.217%]

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

  • 🟥 execution_time [+301.583ms; +306.341ms] or [+151.441%; +153.830%]

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

  • 🟥 execution_time [+304.482ms; +306.794ms] or [+154.414%; +155.586%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+300.216ms; +300.880ms] or [+149.749%; +150.081%]
  • 🟩 throughput [+61212809.309op/s; +61477696.564op/s] or [+44.579%; +44.772%]

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

  • unstable execution_time [+378.698ms; +410.660ms] or [+470.979%; +510.729%]
  • 🟩 throughput [+1013.590op/s; +1187.341op/s] or [+7.836%; +9.179%]

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

  • 🟥 execution_time [+299.123ms; +300.046ms] or [+149.196%; +149.656%]

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

  • 🟩 throughput [+91789.318op/s; +100381.426op/s] or [+8.570%; +9.372%]

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

  • 🟩 throughput [+49913.395op/s; +69515.912op/s] or [+5.777%; +8.046%]

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

  • 🟩 throughput [+85318.675op/s; +115488.916op/s] or [+6.604%; +8.939%]

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

  • 🟩 throughput [+85014.246op/s; +95412.778op/s] or [+8.443%; +9.476%]

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

  • 🟩 throughput [+52864.303op/s; +57951.824op/s] or [+9.599%; +10.523%]

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

  • 🟩 throughput [+29663.920op/s; +39523.409op/s] or [+6.640%; +8.847%]

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

  • 🟩 throughput [+87401.408op/s; +104545.203op/s] or [+9.765%; +11.680%]

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.ObjectExtractorMoreComplexBody netcoreapp3.1
  • 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.StringConcatAspectBenchmark 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

@e-n-0 e-n-0 changed the title Fix IAST strings second enumeration Fix IAST strings deferred enumerable May 5, 2026
@e-n-0
e-n-0 marked this pull request as ready for review May 5, 2026 11:41

@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 for looking into this! I have a few suggestions I think we should consider:

  • Is ICollection<T> or IReadOnlyCollection<T> good enough? If so, that could avoid allocating for many more scenarios (would only allocate for "true" IEnumerable, not List<T>, T[], Stack<T> (read only colleciton) etc
  • Using ToList() is probably preferable if it doesn't have to be an array
  • I think we should avoid the explicit throw calls

Comment thread tracer/src/Datadog.Trace/Iast/Aspects/System.Text/StringBuilderAspects.cs Outdated
Comment thread tracer/src/Datadog.Trace/Iast/Aspects/System/StringAspects.cs Outdated
throw new ArgumentNullException(nameof(values));
}

return values as T[] ?? values.ToArray();

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.

I wonder... is T[] the correct choice here? Would ICollection<T> be sufficient? Also, should we call ToList() here - I assume it doesn't have to be an array? My reasons are:

  • If the customer passes in a List<T> (for example) this will unecessarily allocate currently. I think an ICollection implementation would be "good enough" as it doesn't have the "delayed execution" semantics? Or IList<T> if we really need it?
  • ToArray() generally allocates more than ToList() (because under the hood it uses a List, and then has to allocate a "final" array.

So maybe this is preferable (we'd need to adjust the method signatures obviously)

Suggested change
return values as T[] ?? values.ToArray();
return values as ICollection<T> ?? values.ToList();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Looking at the ICollection<T> or IReadOnlyCollection<T>, I guess IReadOnlyCollection<T> would be the preferred choice (Stack and Queue would be missed if only using the ICollection<T>, no?)

About the .ToArray() vs .ToList(), I'm good changing that to .ToList().
However, .ToArray() seems to be widely used in the IAST source (might be worth to change them in the future?)

return string.Join(separator, materializedValues);
}

private static IReadOnlyCollection<T> Materialize<T>(IEnumerable<T> values)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

NIT: Since this is the same Materialize code, it might be worth to extract to a shared class.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added an helper extension in 52dbf23

@NachoEchevarria NachoEchevarria left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@e-n-0
e-n-0 requested a review from andrewlock May 5, 2026 13:44

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

@dd-trace-dotnet-ci-bot

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8556) 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
duration73.90 ± (73.93 - 74.52) ms74.57 ± (74.55 - 75.07) ms+0.9%✅⬆️
.NET Framework 4.8 - Bailout
duration77.18 ± (77.03 - 77.39) ms77.17 ± (76.92 - 77.27) ms-0.0%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1083.96 ± (1081.91 - 1088.04) ms1079.60 ± (1077.62 - 1084.20) ms-0.4%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.69 ± (22.64 - 22.75) ms22.49 ± (22.44 - 22.54) ms-0.9%
process.time_to_main_ms85.26 ± (85.01 - 85.50) ms86.33 ± (86.06 - 86.60) ms+1.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.92 ± (10.92 - 10.92) MB10.93 ± (10.93 - 10.93) MB+0.1%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.42 ± (22.38 - 22.46) ms22.14 ± (22.11 - 22.17) ms-1.2%
process.time_to_main_ms85.86 ± (85.62 - 86.10) ms85.35 ± (85.15 - 85.56) ms-0.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.90 ± (10.89 - 10.90) MB10.96 ± (10.95 - 10.96) MB+0.5%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms214.41 ± (213.59 - 215.23) ms214.85 ± (213.92 - 215.77) ms+0.2%✅⬆️
process.time_to_main_ms533.28 ± (531.96 - 534.59) ms530.17 ± (528.81 - 531.52) ms-0.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed47.86 ± (47.84 - 47.89) MB47.97 ± (47.94 - 47.99) MB+0.2%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%
.NET 6 - Baseline
process.internal_duration_ms21.10 ± (21.06 - 21.14) ms21.30 ± (21.25 - 21.36) ms+1.0%✅⬆️
process.time_to_main_ms73.46 ± (73.25 - 73.66) ms73.44 ± (73.22 - 73.66) ms-0.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.62 ± (10.62 - 10.62) MB10.65 ± (10.64 - 10.65) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.17 ± (21.11 - 21.22) ms21.77 ± (21.71 - 21.83) ms+2.8%✅⬆️
process.time_to_main_ms75.31 ± (75.03 - 75.58) ms78.64 ± (78.33 - 78.96) ms+4.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.73 ± (10.72 - 10.73) MB10.74 ± (10.74 - 10.75) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms383.02 ± (381.07 - 384.97) ms378.67 ± (376.71 - 380.64) ms-1.1%
process.time_to_main_ms530.99 ± (529.75 - 532.23) ms534.39 ± (532.92 - 535.86) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.35 ± (49.32 - 49.38) MB49.47 ± (49.44 - 49.50) MB+0.2%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.87 ± (19.81 - 19.93) ms19.58 ± (19.54 - 19.62) ms-1.4%
process.time_to_main_ms75.58 ± (75.30 - 75.85) ms73.80 ± (73.63 - 73.97) ms-2.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.67 ± (7.67 - 7.68) MB7.66 ± (7.66 - 7.67) MB-0.1%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.56 ± (19.52 - 19.59) ms19.44 ± (19.40 - 19.49) ms-0.6%
process.time_to_main_ms74.78 ± (74.66 - 74.91) ms74.18 ± (74.03 - 74.33) ms-0.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.71 ± (7.70 - 7.72) MB7.71 ± (7.70 - 7.72) MB-0.0%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms302.85 ± (300.38 - 305.31) ms304.03 ± (301.71 - 306.35) ms+0.4%✅⬆️
process.time_to_main_ms491.22 ± (490.07 - 492.37) ms493.29 ± (491.92 - 494.67) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.57 ± (36.54 - 36.60) MB36.55 ± (36.52 - 36.58) MB-0.1%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.2%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration201.49 ± (201.03 - 201.91) ms203.04 ± (202.44 - 203.43) ms+0.8%✅⬆️
.NET Framework 4.8 - Bailout
duration204.09 ± (203.77 - 204.87) ms205.33 ± (205.03 - 205.99) ms+0.6%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1182.88 ± (1180.76 - 1187.10) ms1190.98 ± (1190.25 - 1196.72) ms+0.7%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms190.92 ± (190.47 - 191.37) ms195.26 ± (194.76 - 195.76) ms+2.3%✅⬆️
process.time_to_main_ms83.19 ± (82.98 - 83.41) ms85.42 ± (85.13 - 85.70) ms+2.7%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.04 ± (16.02 - 16.06) MB16.02 ± (16.01 - 16.04) MB-0.1%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.2%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms191.48 ± (190.95 - 192.02) ms193.86 ± (193.37 - 194.35) ms+1.2%✅⬆️
process.time_to_main_ms84.75 ± (84.56 - 84.95) ms86.37 ± (86.08 - 86.66) ms+1.9%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.08 ± (16.07 - 16.10) MB16.06 ± (16.03 - 16.08) MB-0.2%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)+0.0%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms385.31 ± (383.88 - 386.74) ms390.23 ± (388.98 - 391.49) ms+1.3%✅⬆️
process.time_to_main_ms520.13 ± (518.80 - 521.47) ms529.40 ± (528.00 - 530.81) ms+1.8%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed57.14 ± (57.00 - 57.28) MB57.83 ± (57.65 - 58.02) MB+1.2%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.4%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms195.67 ± (195.17 - 196.16) ms200.72 ± (200.20 - 201.23) ms+2.6%✅⬆️
process.time_to_main_ms72.26 ± (72.06 - 72.46) ms73.93 ± (73.71 - 74.16) ms+2.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.34 ± (16.32 - 16.36) MB16.32 ± (16.31 - 16.34) MB-0.1%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.3%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms197.18 ± (196.62 - 197.74) ms199.44 ± (198.92 - 199.95) ms+1.1%✅⬆️
process.time_to_main_ms73.71 ± (73.48 - 73.94) ms75.27 ± (75.05 - 75.49) ms+2.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.42 ± (16.40 - 16.44) MB16.34 ± (16.32 - 16.36) MB-0.5%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.9%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms597.26 ± (594.81 - 599.72) ms595.00 ± (592.12 - 597.88) ms-0.4%
process.time_to_main_ms522.64 ± (521.41 - 523.87) ms530.84 ± (529.47 - 532.21) ms+1.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.02 ± (60.92 - 61.11) MB61.10 ± (61.01 - 61.20) MB+0.1%✅⬆️
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)+0.4%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms197.68 ± (197.19 - 198.17) ms194.32 ± (193.85 - 194.80) ms-1.7%
process.time_to_main_ms73.21 ± (72.99 - 73.43) ms71.79 ± (71.60 - 71.97) ms-1.9%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.64 ± (11.62 - 11.66) MB11.70 ± (11.68 - 11.71) MB+0.5%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.6%
.NET 8 - Bailout
process.internal_duration_ms197.86 ± (197.37 - 198.35) ms193.26 ± (192.68 - 193.83) ms-2.3%
process.time_to_main_ms74.53 ± (74.33 - 74.73) ms72.79 ± (72.60 - 72.97) ms-2.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.65 ± (11.64 - 11.67) MB11.73 ± (11.71 - 11.75) MB+0.7%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.8%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms517.19 ± (513.97 - 520.40) ms518.11 ± (515.41 - 520.82) ms+0.2%✅⬆️
process.time_to_main_ms488.86 ± (487.82 - 489.91) ms491.63 ± (490.56 - 492.70) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.39 ± (50.35 - 50.43) MB50.32 ± (50.28 - 50.35) MB-0.1%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-0.1%
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 (8556) - mean (75ms)  : 71, 78
    master - mean (74ms)  : 70, 79

    section Bailout
    This PR (8556) - mean (77ms)  : 75, 79
    master - mean (77ms)  : 75, 79

    section CallTarget+Inlining+NGEN
    This PR (8556) - mean (1,081ms)  : 1033, 1129
    master - mean (1,085ms)  : 1041, 1129

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 (8556) - mean (116ms)  : 110, 123
    master - mean (115ms)  : 110, 120

    section Bailout
    This PR (8556) - mean (114ms)  : 111, 117
    master - mean (115ms)  : 112, 118

    section CallTarget+Inlining+NGEN
    This PR (8556) - mean (783ms)  : 756, 809
    master - mean (787ms)  : 754, 820

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

    section Bailout
    This PR (8556) - mean (107ms)  : 102, 113
    master - mean (103ms)  : 98, 108

    section CallTarget+Inlining+NGEN
    This PR (8556) - mean (944ms)  : 903, 985
    master - mean (941ms)  : 903, 980

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8556) - mean (101ms)  : 98, 105
    master - mean (103ms)  : 97, 109

    section Bailout
    This PR (8556) - mean (101ms)  : 99, 104
    master - mean (102ms)  : 101, 104

    section CallTarget+Inlining+NGEN
    This PR (8556) - mean (828ms)  : 787, 869
    master - mean (824ms)  : 781, 868

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 (8556) - mean (203ms)  : 197, 209
    master - mean (201ms)  : 196, 207

    section Bailout
    This PR (8556) - mean (206ms)  : 201, 210
    master - mean (204ms)  : 198, 211

    section CallTarget+Inlining+NGEN
    This PR (8556) - mean (1,193ms)  : 1147, 1240
    master - mean (1,184ms)  : 1139, 1229

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 (8556) - mean (290ms)  : 281, 299
    master - mean (284ms)  : 272, 295

    section Bailout
    This PR (8556) - mean (289ms)  : 281, 297
    master - mean (285ms)  : 274, 297

    section CallTarget+Inlining+NGEN
    This PR (8556) - mean (955ms)  : 928, 982
    master - mean (938ms)  : 910, 966

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8556) - mean (283ms)  : 273, 293
    master - mean (277ms)  : 265, 289

    section Bailout
    This PR (8556) - mean (283ms)  : 273, 293
    master - mean (279ms)  : 266, 292

    section CallTarget+Inlining+NGEN
    This PR (8556) - mean (1,155ms)  : 1106, 1204
    master - mean (1,151ms)  : 1108, 1193

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8556) - mean (277ms)  : 265, 289
    master - mean (281ms)  : 270, 293

    section Bailout
    This PR (8556) - mean (276ms)  : 267, 285
    master - mean (283ms)  : 273, 292

    section CallTarget+Inlining+NGEN
    This PR (8556) - mean (1,043ms)  : 992, 1094
    master - mean (1,038ms)  : 986, 1091

Loading

@e-n-0
e-n-0 merged commit 3673951 into master May 5, 2026
138 checks passed
@e-n-0
e-n-0 deleted the flavien.darche/iast-fix-deferred-enums branch May 5, 2026 16:27
@github-actions github-actions Bot added this to the vNext-v3 milestone May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants