Skip to content

[AppSec] Free the WAF diagnostics of every config applied to the builder - #9056

Open
dromanol wants to merge 1 commit into
masterfrom
dani/waf-diagnostics-leak-per-config
Open

[AppSec] Free the WAF diagnostics of every config applied to the builder#9056
dromanol wants to merge 1 commit into
masterfrom
dani/waf-diagnostics-leak-per-config

Conversation

@dromanol

Copy link
Copy Markdown
Contributor

Summary of changes

WafConfigurator.Update now uses a fresh DdwafObjectStruct for each ddwaf_builder_add_or_update_config call and releases the previous one, instead of passing the same object to every call in the loop.

Reason for change

ddwaf_builder_add_or_update_config allocates a brand new diagnostics tree on every call and overwrites the object it is given without freeing it. libddwaf is explicit about it (src/interface.cpp):

if (diagnostics != nullptr) {
    // avoid to_borrowed(diagnostics, ...) = ... as that would destroy
    // the current value in diagnostics, which could be uninitialized
    *to_ptr(diagnostics) = ri.to_object().move();
}

We passed a single diagnostics through the whole configs.Updates loop and the caller (Waf.Create / Waf.Update) destroyed it once, so every config but the last leaked its diagnostics tree. That is native memory invisible to the GC, leaked on each WAF init and on every RCM update cycle that carries more than one config.

The same file already got this right for the obfuscator config (ApplyObfuscatorConfig, with the comment "diagnostics are always allocated by the WAF with the default allocator"); this brings the ruleset loop in line.

Implementation details

Per iteration: pass a local configDiagnostics, then ObjectDestroy the accumulated diagnostics and take over the new one. Reported diagnostics semantics are unchanged — the last applied config still wins, which is what the WAF's overwrite already gave us — so UpdateResult/telemetry output is identical.

Test coverage

Covered indirectly by the existing WAF init/update tests (Datadog.Trace.Security.Unit.Tests), which assert the reported diagnostics after applying multiple configs; the behaviour they check is unchanged. The leak itself is native and not observable from a managed unit test.

Other details

Found while investigating native memory growth with AppSec enabled (SCRS-2370). This is a real but small leak (tens of KB per update cycle) and is not the main suspect for that escalation — it is filed separately because it is an independent bug.

@dromanol
dromanol requested a review from a team as a code owner August 14, 2026 09:47
@dromanol

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 656cebfd91

ℹ️ 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".

@pr-commenter

pr-commenter Bot commented Aug 14, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-14 15:16:11

Comparing candidate commit 77e6fcc in PR branch dani/waf-diagnostics-leak-per-config with baseline commit 57f3327 in branch master.

📊 Benchmarking dashboard

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

scenario:Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery net472

  • 🟥 throughput [-34235.510op/s; -31240.325op/s] or [-9.642%; -8.799%]

scenario:Benchmarks.Trace.HttpClientBenchmark.SendAsync net6.0

  • 🟩 throughput [+8954.403op/s; +10947.417op/s] or [+6.083%; +7.437%]

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 [-8898.545op/s; -8428.155op/s] or [-10.551%; -9.993%]

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

  • 🟥 throughput [-9558.322op/s; -8340.713op/s] or [-9.719%; -8.481%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 allocated_mem [+1.605KB; +1.605KB] or [+48.760%; +48.776%]
  • 🟥 execution_time [+314.992ms; +318.510ms] or [+156.310%; +158.056%]
  • 🟥 throughput [-64.125op/s; -59.450op/s] or [-11.537%; -10.696%]

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

  • 🟥 allocated_mem [+1.012KB; +1.012KB] or [+37.524%; +37.537%]
  • 🟥 execution_time [+378.568ms; +382.493ms] or [+299.092%; +302.193%]
  • 🟩 throughput [+65.781op/s; +70.674op/s] or [+8.673%; +9.318%]

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

  • 🟥 allocated_mem [+1.091KB; +1.091KB] or [+40.454%; +40.465%]
  • 🟥 execution_time [+386.281ms; +390.547ms] or [+341.844%; +345.619%]

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

  • 🟥 allocated_mem [+4.693KB; +4.694KB] or [+98.806%; +98.821%]
  • 🟥 throughput [-60478.783op/s; -60120.474op/s] or [-47.056%; -46.777%]

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

  • 🟥 allocated_mem [+3.816KB; +3.816KB] or [+80.699%; +80.711%]
  • 🟩 execution_time [-15.371ms; -11.189ms] or [-7.179%; -5.226%]
  • 🟥 throughput [-60604.714op/s; -57839.831op/s] or [-44.238%; -42.220%]

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

  • 🟥 allocated_mem [+4.544KB; +4.544KB] or [+98.261%; +98.274%]
  • 🟥 throughput [-48495.865op/s; -46250.064op/s] or [-43.846%; -41.815%]

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

  • 🟥 allocated_mem [+1.316KB; +1.316KB] or [+106.475%; +106.490%]
  • 🟥 throughput [-252033.068op/s; -248478.274op/s] or [-25.734%; -25.371%]

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

  • 🟥 allocated_mem [+479 bytes; +480 bytes] or [+39.212%; +39.221%]
  • 🟩 execution_time [-25.665ms; -20.774ms] or [-11.445%; -9.264%]
  • 🟥 throughput [-76472.166op/s; -53115.526op/s] or [-8.170%; -5.674%]

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

  • 🟥 allocated_mem [+1.280KB; +1.280KB] or [+105.947%; +105.963%]
  • 🟥 throughput [-159273.707op/s; -142724.325op/s] or [-22.885%; -20.507%]

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

  • 🟥 allocated_mem [+3.378KB; +3.378KB] or [+89.003%; +89.017%]
  • 🟥 throughput [-72581.876op/s; -71827.261op/s] or [-48.847%; -48.339%]

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

  • 🟥 allocated_mem [+3.336KB; +3.336KB] or [+88.150%; +88.161%]
  • 🟩 execution_time [-34.716ms; -16.157ms] or [-17.516%; -8.152%]
  • 🟥 throughput [-73981.375op/s; -71043.581op/s] or [-47.073%; -45.204%]

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

  • 🟥 allocated_mem [+3.264KB; +3.264KB] or [+88.493%; +88.506%]
  • 🟥 throughput [-55491.186op/s; -52879.672op/s] or [-44.206%; -42.126%]

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

  • 🟩 throughput [+202055.413op/s; +242701.555op/s] or [+6.737%; +8.093%]

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

  • 🟩 execution_time [-19.031ms; -14.695ms] or [-8.773%; -6.774%]

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

  • 🟩 allocated_mem [-13.759KB; -13.757KB] or [-42.326%; -42.318%]
  • 🟥 execution_time [+299.619ms; +300.374ms] or [+149.709%; +150.087%]
  • 🟩 throughput [+1012.016op/s; +1034.965op/s] or [+11.178%; +11.431%]

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

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • unstable execution_time [+302.737ms; +322.576ms] or [+152.671%; +162.676%]
  • 🟩 throughput [+1448.883op/s; +1986.471op/s] or [+11.082%; +15.194%]

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

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+300.879ms; +304.307ms] or [+151.560%; +153.286%]
  • 🟩 throughput [+1756.058op/s; +1898.182op/s] or [+16.954%; +18.326%]

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

  • 🟥 execution_time [+296.835ms; +298.110ms] or [+145.793%; +146.420%]
  • 🟩 throughput [+557.967op/s; +570.577op/s] or [+14.792%; +15.126%]

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

  • 🟥 execution_time [+297.187ms; +298.659ms] or [+145.284%; +146.003%]
  • 🟩 throughput [+2564.908op/s; +2595.545op/s] or [+37.263%; +37.708%]

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

  • 🟥 execution_time [+299.898ms; +300.575ms] or [+149.889%; +150.227%]
  • 🟩 throughput [+1345.315op/s; +1370.708op/s] or [+26.703%; +27.207%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472

  • 🟩 execution_time [-149.341µs; -145.359µs] or [-30.662%; -29.844%]
  • 🟩 throughput [+877.814op/s; +904.421op/s] or [+42.753%; +44.049%]

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

  • 🟩 execution_time [-138.105µs; -111.425µs] or [-31.675%; -25.556%]
  • 🟩 throughput [+852.249op/s; +974.851op/s] or [+37.052%; +42.383%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1

  • 🟩 execution_time [-142.798µs; -120.778µs] or [-30.595%; -25.877%]
  • 🟩 throughput [+778.099op/s; +861.436op/s] or [+35.919%; +39.766%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472

  • 🟩 execution_time [-128.309µs; -124.011µs] or [-34.643%; -33.482%]
  • 🟩 throughput [+1370.611op/s; +1421.706op/s] or [+50.761%; +52.653%]

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

  • 🟩 execution_time [-101.273µs; -77.650µs] or [-32.331%; -24.790%]
  • 🟩 throughput [+1160.890op/s; +1363.756op/s] or [+36.188%; +42.512%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1

  • 🟩 execution_time [-138.846µs; -116.470µs] or [-37.983%; -31.862%]
  • 🟩 throughput [+1349.511op/s; +1485.937op/s] or [+48.429%; +53.324%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+300.115ms; +300.916ms] or [+149.788%; +150.188%]

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

  • 🟥 execution_time [+414.033ms; +420.730ms] or [+449.863%; +457.140%]
  • 🟩 throughput [+760.400op/s; +911.967op/s] or [+6.248%; +7.494%]

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

  • unstable execution_time [+294.523ms; +346.287ms] or [+223.629%; +262.932%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+305.892ms; +356.603ms] or [+140.646%; +163.963%]
  • 🟥 throughput [-558.202op/s; -502.273op/s] or [-50.579%; -45.511%]

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

  • unstable execution_time [+205.481ms; +338.759ms] or [+87.567%; +144.365%]
  • 🟥 throughput [-669.571op/s; -586.141op/s] or [-44.661%; -39.096%]

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

  • 🟥 allocated_mem [+2.157KB; +2.161KB] or [+5.094%; +5.102%]
  • 🟥 execution_time [+344.165ms; +354.934ms] or [+205.851%; +212.292%]
  • 🟥 throughput [-406.995op/s; -370.835op/s] or [-28.338%; -25.821%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472

  • 🟥 execution_time [+232.493µs; +268.666µs] or [+11.700%; +13.520%]
  • 🟥 throughput [-59.552op/s; -52.436op/s] or [-11.834%; -10.420%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472

  • 🟥 execution_time [+334.463µs; +346.119µs] or [+13.064%; +13.520%]
  • 🟥 throughput [-46.519op/s; -45.105op/s] or [-11.909%; -11.547%]

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

  • 🟩 execution_time [-169.956µs; -117.934µs] or [-8.609%; -5.974%]
  • 🟩 throughput [+34.097op/s; +48.116op/s] or [+6.731%; +9.498%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+297.167ms; +300.908ms] or [+149.648%; +151.532%]

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

  • 🟥 execution_time [+299.060ms; +301.452ms] or [+149.859%; +151.058%]

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

  • 🟥 execution_time [+300.585ms; +304.408ms] or [+151.001%; +152.921%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+301.895ms; +303.740ms] or [+151.602%; +152.528%]

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

  • 🟥 execution_time [+297.466ms; +302.561ms] or [+147.084%; +149.603%]

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

  • 🟥 execution_time [+303.668ms; +307.911ms] or [+153.912%; +156.063%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+302.344ms; +305.301ms] or [+151.750%; +153.234%]

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

  • 🟥 execution_time [+295.047ms; +298.152ms] or [+147.054%; +148.602%]
  • 🟩 throughput [+37721.682op/s; +47038.332op/s] or [+7.490%; +9.340%]

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

  • 🟥 execution_time [+299.099ms; +302.977ms] or [+148.799%; +150.728%]

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

  • 🟩 execution_time [-16.979ms; -13.342ms] or [-7.895%; -6.204%]
  • 🟩 throughput [+21269.606op/s; +27837.844op/s] or [+5.835%; +7.637%]

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

  • unstable execution_time [+21.724µs; +64.903µs] or [+5.366%; +16.031%]
  • 🟥 throughput [-342.430op/s; -129.050op/s] or [-13.780%; -5.193%]

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

  • 🟩 allocated_mem [-24.849KB; -24.826KB] or [-9.064%; -9.056%]
  • unstable execution_time [-16.031µs; +39.030µs] or [-3.168%; +7.714%]

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

  • 🟩 allocated_mem [-18.370KB; -18.352KB] or [-6.697%; -6.690%]
  • unstable execution_time [-66.238µs; -4.095µs] or [-11.479%; -0.710%]
  • unstable throughput [+29.242op/s; +206.985op/s] or [+1.671%; +11.825%]

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

  • unstable execution_time [+8.619µs; +13.224µs] or [+20.373%; +31.257%]
  • 🟥 throughput [-5734.207op/s; -3840.173op/s] or [-24.139%; -16.166%]

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

  • unstable execution_time [-14.320µs; -6.050µs] or [-22.217%; -9.387%]
  • unstable throughput [+1608.255op/s; +3426.613op/s] or [+9.867%; +21.023%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+301.911ms; +303.199ms] or [+152.603%; +153.253%]

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

  • 🟥 execution_time [+304.324ms; +307.566ms] or [+154.900%; +156.550%]

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

  • 🟥 execution_time [+299.697ms; +301.776ms] or [+150.035%; +151.076%]

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

  • 🟩 throughput [+34596.883op/s; +38410.978op/s] or [+6.548%; +7.270%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+299.703ms; +301.874ms] or [+149.375%; +150.457%]

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

  • 🟥 execution_time [+301.980ms; +303.987ms] or [+151.640%; +152.648%]

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

  • 🟥 execution_time [+303.017ms; +309.354ms] or [+153.671%; +156.884%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+298.930ms; +299.895ms] or [+149.108%; +149.589%]
  • 🟩 throughput [+66223538.200op/s; +66662648.861op/s] or [+48.228%; +48.548%]

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

  • unstable execution_time [+342.787ms; +400.957ms] or [+426.317%; +498.661%]

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

  • 🟥 execution_time [+299.513ms; +300.552ms] or [+149.390%; +149.908%]

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

  • 🟩 throughput [+98200.883op/s; +107200.031op/s] or [+9.169%; +10.009%]

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

  • 🟩 throughput [+64607.111op/s; +96960.307op/s] or [+5.001%; +7.505%]

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

  • 🟩 throughput [+69956.680op/s; +77761.896op/s] or [+6.948%; +7.723%]

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

  • 🟩 throughput [+49430.068op/s; +55283.713op/s] or [+8.976%; +10.039%]

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

  • 🟩 throughput [+50321.324op/s; +71986.339op/s] or [+5.622%; +8.043%]

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.ObjectExtractorSimpleBody 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 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.StartFinishScope netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • 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

@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (9056) and master.

⚠️ Potential regressions detected

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration190.62 ± (190.48 - 191.31) ms207.66 ± (207.07 - 207.93) ms+8.9%❌⬆️
.NET Framework 4.8 - Bailout
duration194.65 ± (194.57 - 195.15) ms211.50 ± (211.11 - 211.93) ms+8.7%❌⬆️

📄 View the full report (charts + all metrics) →

ddwaf_builder_add_or_update_config allocates a fresh diagnostics object on
every call and overwrites the one it is given without freeing it, so reusing
a single object across the loop leaked all but the last one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

Remove comments on WAF diagnostics object handling

Removed comments about WAF diagnostics object allocation and reuse.
@dromanol
dromanol force-pushed the dani/waf-diagnostics-leak-per-config branch from 656cebf to 77e6fcc Compare August 14, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant