Skip to content

[OTLP Logs] Fix ArgumentOutOfRangeException serializing large log batches (pooled buffers)#8862

Draft
NachoEchevarria wants to merge 4 commits into
masterfrom
nacho/OtelExceptionArrayPool
Draft

[OTLP Logs] Fix ArgumentOutOfRangeException serializing large log batches (pooled buffers)#8862
NachoEchevarria wants to merge 4 commits into
masterfrom
nacho/OtelExceptionArrayPool

Conversation

@NachoEchevarria

@NachoEchevarria NachoEchevarria commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary of changes

Fix an ArgumentOutOfRangeException when serializing OTLP log batches that exceed 64 KB, and serialize into a pooled, growable buffer bounded at 3 MB.

Seen here.

Reason for change

OtlpLogsSerializer wrote into a fixed 64 KB buffer with no bounds checking or resizing. Once a batch's serialized size crossed 64 KB, the next write threw ArgumentOutOfRangeException (surfacing in WriteLogRecord due to inlining), the batch failed to send, and it was dropped.

This is rare in practice — error tracking shows very few occurrences — but when it does happen it's a hard failure that silently drops the batch, so it's worth guarding against.

Implementation details

  • OtlpLogsSerializer.TrySerializeLogs now serializes into a caller-provided buffer and returns false (instead of throwing) when the batch doesn't fit. Overflow is detected via the ArgumentException/IndexOutOfRangeException the writers already throw, keeping the common path allocation-free rather than pre-sizing every batch.
  • OtlpExporter owns the buffer: it rents from ArrayPool<byte>.Shared, grows it (doubling) up to a 3 MB cap on overflow, and returns it to the pool once the request completes (the send path consumes it synchronously). This removes the per-export buffer and result-copy allocations.
  • A batch that still doesn't fit at the cap is dropped: the exporter logs a warning and reports success so the batching sink doesn't trip its circuit breaker for this non-transient case. The 3 MB cap matches our direct log submission (DirectSubmissionLogSink.MaxTotalSizeBytes).

Test coverage

Added OtlpLogsSerializerTests: small/empty batches, buffer-too-small returns false without throwing (the original crash repro), fits-in-larger-buffer, and start-position handling.

Other details

Alternative to #8858 (simple grow-and-retry). Keeping both open for now to compare approaches.

@NachoEchevarria NachoEchevarria changed the title Nacho/otel exception array pool [OTLP Logs] Fix ArgumentOutOfRangeException serializing large log batches (pooled buffers) Jul 2, 2026
@pr-commenter

pr-commenter Bot commented Jul 2, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-02 14:46:55

Comparing candidate commit 9078d4b in PR branch nacho/OtelExceptionArrayPool with baseline commit e5a5082 in branch master.

📊 Benchmarking dashboard

Found 2 performance improvements and 0 performance regressions! Performance is the same for 70 metrics, 0 unstable metrics, 62 known flaky benchmarks, 64 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.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartActiveSpan net472

  • 🟩 throughput [+13672.962op/s; +14507.498op/s] or [+7.417%; +7.870%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartSpan_SetActive net472

  • 🟩 throughput [+8731.300op/s; +9588.857op/s] or [+5.304%; +5.825%]

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 [-6588.893op/s; -6099.113op/s] or [-7.812%; -7.232%]

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

  • unstable execution_time [-27.848ms; -5.558ms] or [-14.007%; -2.795%]
  • 🟥 throughput [-8092.149op/s; -6734.409op/s] or [-8.228%; -6.847%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+312.586ms; +319.236ms] or [+155.116%; +158.416%]
  • 🟥 throughput [-44.856op/s; -40.268op/s] or [-8.070%; -7.245%]

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

  • 🟥 execution_time [+378.633ms; +381.763ms] or [+299.143%; +301.616%]
  • 🟩 throughput [+97.910op/s; +102.721op/s] or [+12.909%; +13.543%]

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

  • 🟥 execution_time [+388.505ms; +390.199ms] or [+343.812%; +345.311%]

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

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

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.976%; +9.987%]
  • 🟩 execution_time [-15.980ms; -11.813ms] or [-7.463%; -5.517%]

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

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

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

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.743%; +105.758%]
  • 🟥 throughput [-267350.523op/s; -264033.956op/s] or [-27.298%; -26.959%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.557%; +38.566%]
  • 🟩 execution_time [-28.098ms; -13.939ms] or [-12.531%; -6.216%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.288%; +105.304%]
  • 🟥 throughput [-156407.544op/s; -140083.354op/s] or [-22.473%; -20.127%]

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

  • 🟩 throughput [+8494.485op/s; +11401.462op/s] or [+5.405%; +7.255%]

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

  • 🟩 throughput [+9839.923op/s; +12557.463op/s] or [+7.839%; +10.004%]

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

  • 🟩 throughput [+450792.523op/s; +475979.685op/s] or [+15.031%; +15.871%]

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

  • 🟩 execution_time [-20.485ms; -15.827ms] or [-9.443%; -7.296%]

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

  • 🟥 execution_time [+299.830ms; +300.869ms] or [+149.815%; +150.334%]

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

  • 🟥 execution_time [+298.105ms; +301.654ms] or [+150.335%; +152.125%]
  • 🟩 throughput [+697.420op/s; +916.814op/s] or [+5.334%; +7.012%]

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

  • 🟥 execution_time [+299.943ms; +302.372ms] or [+151.088%; +152.312%]

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

  • 🟥 execution_time [+297.539ms; +298.597ms] or [+146.140%; +146.659%]

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

  • 🟥 execution_time [+297.076ms; +300.666ms] or [+145.230%; +146.985%]

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

  • 🟥 execution_time [+298.872ms; +300.120ms] or [+149.376%; +150.000%]

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

  • 🟥 execution_time [+24.857µs; +48.484µs] or [+7.936%; +15.479%]
  • 🟥 throughput [-449.000op/s; -250.212op/s] or [-13.997%; -7.800%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+300.234ms; +300.947ms] or [+149.847%; +150.203%]

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

  • unstable execution_time [+415.879ms; +425.629ms] or [+451.870%; +462.463%]
  • 🟩 throughput [+754.979op/s; +929.284op/s] or [+6.204%; +7.636%]

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

  • unstable execution_time [+232.621ms; +304.692ms] or [+176.627%; +231.350%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 allocated_mem [+2.822KB; +2.828KB] or [+5.014%; +5.024%]
  • unstable execution_time [+247.216ms; +322.443ms] or [+113.668%; +148.256%]
  • 🟥 throughput [-564.462op/s; -497.161op/s] or [-51.146%; -45.048%]

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

  • unstable execution_time [+145.826ms; +291.548ms] or [+62.145%; +124.246%]
  • 🟥 throughput [-673.939op/s; -590.448op/s] or [-44.952%; -39.383%]

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

  • 🟥 execution_time [+334.493ms; +347.565ms] or [+200.065%; +207.884%]
  • 🟥 throughput [-391.186op/s; -350.059op/s] or [-27.238%; -24.374%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1

  • unstable throughput [+21.048op/s; +70.492op/s] or [+6.050%; +20.263%]

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

  • 🟩 execution_time [-189.422µs; -141.848µs] or [-9.595%; -7.185%]
  • 🟩 throughput [+40.757op/s; +54.294op/s] or [+8.046%; +10.718%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+304.451ms; +306.274ms] or [+153.316%; +154.234%]

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

  • 🟥 execution_time [+300.632ms; +303.334ms] or [+150.647%; +152.001%]

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

  • 🟥 execution_time [+303.222ms; +306.692ms] or [+152.326%; +154.069%]
  • 🟩 throughput [+27975.772op/s; +35923.057op/s] or [+5.893%; +7.567%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+300.560ms; +302.279ms] or [+150.931%; +151.795%]

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

  • 🟥 execution_time [+297.950ms; +300.367ms] or [+147.323%; +148.518%]

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

  • 🟥 execution_time [+302.395ms; +306.027ms] or [+153.267%; +155.108%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+302.595ms; +305.258ms] or [+151.875%; +153.212%]

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

  • 🟥 execution_time [+299.553ms; +303.286ms] or [+149.300%; +151.160%]
  • 🟩 throughput [+42653.791op/s; +49065.850op/s] or [+8.470%; +9.743%]

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

  • 🟥 execution_time [+300.935ms; +303.479ms] or [+149.713%; +150.978%]

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

  • 🟩 execution_time [-16.579ms; -12.934ms] or [-7.709%; -6.014%]
  • 🟩 throughput [+26105.760op/s; +32707.927op/s] or [+7.162%; +8.973%]

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

  • unstable execution_time [+8.156µs; +51.538µs] or [+2.015%; +12.730%]

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

  • 🟩 allocated_mem [-26.999KB; -26.977KB] or [-9.849%; -9.841%]
  • unstable execution_time [-50.491µs; +6.194µs] or [-9.979%; +1.224%]
  • unstable throughput [-13.164op/s; +187.511op/s] or [-0.657%; +9.357%]

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

  • unstable execution_time [-52.155µs; +8.202µs] or [-9.038%; +1.421%]

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

  • unstable execution_time [+8.385µs; +13.310µs] or [+19.819%; +31.461%]
  • 🟥 throughput [-5686.087op/s; -3762.133op/s] or [-23.937%; -15.837%]

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

  • unstable execution_time [-15.619µs; -8.767µs] or [-24.232%; -13.602%]
  • 🟩 throughput [+2208.014op/s; +3649.664op/s] or [+13.547%; +22.392%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+300.790ms; +302.602ms] or [+152.036%; +152.952%]

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

  • 🟥 execution_time [+302.364ms; +304.817ms] or [+153.902%; +155.151%]

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

  • 🟥 execution_time [+299.732ms; +302.224ms] or [+150.053%; +151.300%]

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

  • 🟩 throughput [+33236.743op/s; +36425.559op/s] or [+6.291%; +6.895%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+299.689ms; +301.434ms] or [+149.368%; +150.238%]

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

  • 🟥 execution_time [+300.363ms; +302.954ms] or [+150.828%; +152.129%]

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

  • 🟥 execution_time [+302.095ms; +304.407ms] or [+153.203%; +154.376%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.852ms; +300.826ms] or [+149.568%; +150.053%]
  • 🟩 throughput [+61034790.754op/s; +61392434.603op/s] or [+44.449%; +44.710%]

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

  • 🟥 execution_time [+420.557ms; +424.538ms] or [+523.037%; +527.989%]

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

  • 🟥 execution_time [+299.032ms; +300.221ms] or [+149.150%; +149.743%]

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

  • 🟩 throughput [+99633.206op/s; +107790.680op/s] or [+9.302%; +10.064%]

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

  • 🟩 throughput [+46634.005op/s; +66059.552op/s] or [+5.398%; +7.646%]

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

  • 🟩 throughput [+94059.204op/s; +124495.619op/s] or [+7.280%; +9.636%]

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

  • 🟩 throughput [+77814.507op/s; +88200.645op/s] or [+7.728%; +8.760%]

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

  • 🟩 throughput [+51742.809op/s; +57130.905op/s] or [+9.396%; +10.374%]

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

  • 🟩 throughput [+26407.802op/s; +36010.904op/s] or [+5.911%; +8.060%]

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

  • 🟩 throughput [+82086.701op/s; +100580.227op/s] or [+9.171%; +11.237%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@dd-trace-dotnet-ci-bot

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8862) 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
duration71.48 ± (71.50 - 72.11) ms69.47 ± (69.52 - 69.80) ms-2.8%
.NET Framework 4.8 - Bailout
duration76.72 ± (76.56 - 77.02) ms73.15 ± (73.03 - 73.28) ms-4.7%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1081.99 ± (1080.91 - 1086.94) ms1084.38 ± (1081.51 - 1087.10) ms+0.2%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.45 ± (22.39 - 22.51) ms22.02 ± (21.99 - 22.05) ms-1.9%
process.time_to_main_ms82.88 ± (82.59 - 83.17) ms80.69 ± (80.52 - 80.87) ms-2.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.93 ± (10.93 - 10.93) MB10.92 ± (10.91 - 10.92) MB-0.1%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.16 ± (22.13 - 22.19) ms21.84 ± (21.82 - 21.87) ms-1.4%
process.time_to_main_ms82.62 ± (82.42 - 82.83) ms81.40 ± (81.29 - 81.52) ms-1.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.96 ± (10.96 - 10.97) MB10.94 ± (10.94 - 10.94) MB-0.2%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms210.64 ± (209.81 - 211.47) ms210.51 ± (209.66 - 211.36) ms-0.1%
process.time_to_main_ms532.07 ± (530.79 - 533.36) ms532.86 ± (531.58 - 534.15) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.27 ± (49.25 - 49.29) MB49.22 ± (49.19 - 49.25) MB-0.1%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.1%
.NET 6 - Baseline
process.internal_duration_ms21.31 ± (21.25 - 21.37) ms20.94 ± (20.90 - 20.98) ms-1.7%
process.time_to_main_ms72.69 ± (72.42 - 72.97) ms69.68 ± (69.56 - 69.79) ms-4.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.63 ± (10.63 - 10.64) MB10.61 ± (10.61 - 10.61) MB-0.2%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.91 ± (20.87 - 20.96) ms21.21 ± (21.16 - 21.26) ms+1.4%✅⬆️
process.time_to_main_ms71.44 ± (71.26 - 71.63) ms73.62 ± (73.38 - 73.86) ms+3.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.74 ± (10.74 - 10.74) MB10.73 ± (10.73 - 10.73) MB-0.1%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms370.47 ± (368.61 - 372.33) ms374.56 ± (372.37 - 376.74) ms+1.1%✅⬆️
process.time_to_main_ms537.48 ± (536.44 - 538.52) ms538.75 ± (537.37 - 540.12) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed50.33 ± (50.30 - 50.35) MB50.27 ± (50.24 - 50.29) MB-0.1%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 8 - Baseline
process.internal_duration_ms18.99 ± (18.96 - 19.01) ms19.10 ± (19.07 - 19.13) ms+0.6%✅⬆️
process.time_to_main_ms68.52 ± (68.39 - 68.66) ms69.26 ± (69.08 - 69.45) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.66 - 7.67) MB7.66 ± (7.65 - 7.67) MB-0.0%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.23 ± (19.18 - 19.27) ms19.11 ± (19.07 - 19.15) ms-0.6%
process.time_to_main_ms72.21 ± (71.95 - 72.46) ms70.20 ± (70.08 - 70.32) ms-2.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.72 ± (7.72 - 7.73) MB7.70 ± (7.69 - 7.71) MB-0.3%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms297.66 ± (294.91 - 300.42) ms295.29 ± (292.89 - 297.68) ms-0.8%
process.time_to_main_ms482.55 ± (481.67 - 483.43) ms487.39 ± (486.37 - 488.42) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed37.63 ± (37.60 - 37.65) MB37.59 ± (37.56 - 37.61) MB-0.1%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.1%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration202.58 ± (202.14 - 203.04) ms203.76 ± (203.55 - 204.54) ms+0.6%✅⬆️
.NET Framework 4.8 - Bailout
duration206.37 ± (206.18 - 207.25) ms209.66 ± (208.85 - 209.76) ms+1.6%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1211.07 ± (1210.41 - 1216.51) ms1221.19 ± (1220.04 - 1227.15) ms+0.8%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms195.90 ± (195.46 - 196.33) ms196.83 ± (196.42 - 197.25) ms+0.5%✅⬆️
process.time_to_main_ms84.94 ± (84.61 - 85.27) ms85.53 ± (85.17 - 85.90) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.09 ± (16.07 - 16.11) MB16.10 ± (16.07 - 16.13) MB+0.1%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.6%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms194.11 ± (193.75 - 194.47) ms197.41 ± (196.90 - 197.93) ms+1.7%✅⬆️
process.time_to_main_ms85.77 ± (85.57 - 85.97) ms87.40 ± (87.13 - 87.66) ms+1.9%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.11 ± (16.09 - 16.13) MB16.10 ± (16.07 - 16.12) MB-0.1%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (20 - 21)-0.3%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms388.28 ± (386.91 - 389.65) ms386.84 ± (385.33 - 388.35) ms-0.4%
process.time_to_main_ms542.71 ± (541.36 - 544.05) ms545.66 ± (544.34 - 546.97) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.53 ± (58.32 - 58.74) MB58.35 ± (58.14 - 58.56) MB-0.3%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.1%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms199.97 ± (199.50 - 200.43) ms200.19 ± (199.67 - 200.70) ms+0.1%✅⬆️
process.time_to_main_ms73.82 ± (73.59 - 74.05) ms74.07 ± (73.78 - 74.36) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.36 ± (16.34 - 16.38) MB16.31 ± (16.29 - 16.33) MB-0.3%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.6%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms199.05 ± (198.70 - 199.41) ms198.48 ± (197.92 - 199.04) ms-0.3%
process.time_to_main_ms75.05 ± (74.88 - 75.22) ms74.57 ± (74.34 - 74.80) ms-0.6%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.43 ± (16.41 - 16.45) MB16.42 ± (16.40 - 16.45) MB-0.1%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-0.5%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms583.60 ± (580.92 - 586.28) ms583.91 ± (581.56 - 586.26) ms+0.1%✅⬆️
process.time_to_main_ms552.31 ± (551.23 - 553.39) ms555.74 ± (554.81 - 556.67) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.38 ± (61.30 - 61.45) MB61.33 ± (61.25 - 61.41) MB-0.1%
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)-0.3%
.NET 8 - Baseline
process.internal_duration_ms198.45 ± (198.03 - 198.88) ms199.87 ± (199.46 - 200.28) ms+0.7%✅⬆️
process.time_to_main_ms73.65 ± (73.39 - 73.91) ms74.30 ± (74.01 - 74.58) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.70 ± (11.68 - 11.73) MB11.72 ± (11.69 - 11.74) MB+0.1%✅⬆️
runtime.dotnet.threads.count19 ± (18 - 19)18 ± (18 - 18)-0.8%
.NET 8 - Bailout
process.internal_duration_ms199.19 ± (198.70 - 199.67) ms200.16 ± (199.69 - 200.63) ms+0.5%✅⬆️
process.time_to_main_ms75.58 ± (75.35 - 75.81) ms75.67 ± (75.49 - 75.85) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.75 ± (11.73 - 11.77) MB11.77 ± (11.75 - 11.79) MB+0.2%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)20 ± (20 - 20)+1.5%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms512.93 ± (509.87 - 515.99) ms514.44 ± (511.49 - 517.38) ms+0.3%✅⬆️
process.time_to_main_ms502.79 ± (502.00 - 503.58) ms508.69 ± (507.85 - 509.54) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed51.08 ± (51.04 - 51.11) MB51.15 ± (51.11 - 51.18) MB+0.1%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.4%✅⬆️
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 (8862) - mean (70ms)  : 68, 72
    master - mean (72ms)  : 67, 77

    section Bailout
    This PR (8862) - mean (73ms)  : 72, 74
    master - mean (77ms)  : 73, 80

    section CallTarget+Inlining+NGEN
    This PR (8862) - mean (1,084ms)  : 1044, 1124
    master - mean (1,084ms)  : 1040, 1128

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 (8862) - mean (109ms)  : 105, 113
    master - mean (113ms)  : 106, 120

    section Bailout
    This PR (8862) - mean (110ms)  : 108, 111
    master - mean (112ms)  : 106, 117

    section CallTarget+Inlining+NGEN
    This PR (8862) - mean (781ms)  : 759, 803
    master - mean (780ms)  : 751, 808

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8862) - mean (96ms)  : 94, 99
    master - mean (101ms)  : 95, 107

    section Bailout
    This PR (8862) - mean (102ms)  : 97, 107
    master - mean (99ms)  : 94, 105

    section CallTarget+Inlining+NGEN
    This PR (8862) - mean (944ms)  : 903, 984
    master - mean (937ms)  : 894, 980

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

    section Bailout
    This PR (8862) - mean (97ms)  : 95, 99
    master - mean (99ms)  : 94, 103

    section CallTarget+Inlining+NGEN
    This PR (8862) - mean (817ms)  : 771, 862
    master - mean (814ms)  : 764, 864

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 (8862) - mean (204ms)  : 198, 210
    master - mean (203ms)  : 198, 207

    section Bailout
    This PR (8862) - mean (209ms)  : 204, 214
    master - mean (207ms)  : 201, 212

    section CallTarget+Inlining+NGEN
    This PR (8862) - mean (1,224ms)  : 1171, 1276
    master - mean (1,213ms)  : 1170, 1257

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 (8862) - mean (292ms)  : 286, 298
    master - mean (291ms)  : 282, 300

    section Bailout
    This PR (8862) - mean (295ms)  : 289, 301
    master - mean (290ms)  : 285, 294

    section CallTarget+Inlining+NGEN
    This PR (8862) - mean (976ms)  : 950, 1002
    master - mean (972ms)  : 948, 996

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8862) - mean (284ms)  : 275, 292
    master - mean (284ms)  : 277, 290

    section Bailout
    This PR (8862) - mean (282ms)  : 275, 290
    master - mean (284ms)  : 279, 288

    section CallTarget+Inlining+NGEN
    This PR (8862) - mean (1,172ms)  : 1131, 1213
    master - mean (1,174ms)  : 1136, 1212

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8862) - mean (285ms)  : 280, 290
    master - mean (283ms)  : 277, 289

    section Bailout
    This PR (8862) - mean (287ms)  : 281, 292
    master - mean (285ms)  : 278, 293

    section CallTarget+Inlining+NGEN
    This PR (8862) - mean (1,056ms)  : 1009, 1103
    master - mean (1,048ms)  : 1002, 1093

Loading

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.

1 participant