Skip to content

[SymDB] Stream SymDB payload#8691

Merged
dudikeleti merged 19 commits into
masterfrom
dudik/symdb/stream-upload
May 28, 2026
Merged

[SymDB] Stream SymDB payload#8691
dudikeleti merged 19 commits into
masterfrom
dudik/symdb/stream-upload

Conversation

@dudikeleti

@dudikeleti dudikeleti commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

  • Stream SymDB upload payloads directly into the request body instead of converting the final JSON string to UTF-8 bytes first.
  • Add a streaming ISymbolUploadApi overload for SymDB payload writers.
  • Write SymDB multipart uploads manually so the file part can be streamed and the event metadata can still include the final attachment size.
  • Preserve compressed and uncompressed upload behavior, including multipart part order and event metadata.
  • Add wire-format tests for compressed and uncompressed SymDB multipart uploads.

Reason for change

  • Reduce large intermediate allocations and copies during SymDB uploads.
  • Avoid buffering gzip-compressed SymDB payloads before sending them.
  • Keep backend-sensitive multipart behavior covered by tests while changing the upload implementation.

Implementation details

  • SymbolsUploader keeps the existing batch-building flow, but writes StringBuilder chunks to a StreamWriter asynchronously instead of materializing a final string and byte array.
  • SymbolUploadApi streams the file part first, counts the actual bytes written through a counting stream, then writes the event part with the computed attachmentSize.
  • The .NET Core gzip path uses async disposal so gzip finalization does not rely on synchronous Dispose; the .NET Framework SharpZipLib path remains synchronous.
  • Multipart wire-format tests validate part order, filenames, content types, gzip decompression, event metadata, and attachment size.

Test coverage

  • SymbolUploaderTest|SymbolUploadApiTests
  • System Tests

Other details

Local BenchmarkDotNet results for a 1 MB SymDB batch on net8.0:

Method Before After Change
UploadClasses mean 48.186 ms 41.356 ms -14.2%
UploadClasses allocated 25,800.36 KB 16,022.55 KB -37.9%
SendCompressedMultipart mean 1.922 ms 46.53 us -97.6%
SendCompressedMultipart allocated 77.95 KB 4.52 KB -94.2%

@datadog-prod-us1-3

This comment has been minimized.

@pr-commenter

pr-commenter Bot commented May 26, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-05-28 10:23:53

Comparing candidate commit a87a646 in PR branch dudik/symdb/stream-upload with baseline commit e8fe0e5 in branch master.

Found 0 performance improvements and 1 performance regressions! Performance is the same for 71 metrics, 0 unstable metrics, 60 known flaky benchmarks, 66 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.HttpClientBenchmark.SendAsync net472

  • 🟥 throughput [-4722.382op/s; -4456.936op/s] or [-5.391%; -5.088%]

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 [-6978.976op/s; -6303.074op/s] or [-8.275%; -7.474%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+301.306ms; +307.988ms] or [+149.519%; +152.835%]
  • 🟥 throughput [-45.527op/s; -41.939op/s] or [-8.191%; -7.546%]

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

  • 🟥 execution_time [+381.432ms; +385.853ms] or [+301.355%; +304.847%]
  • 🟩 throughput [+91.743op/s; +97.426op/s] or [+12.096%; +12.845%]

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

  • 🟥 execution_time [+396.048ms; +401.156ms] or [+350.487%; +355.008%]

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.738ms; -11.532ms] or [-7.350%; -5.386%]

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 [-264893.919op/s; -261093.818op/s] or [-27.047%; -26.659%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.557%; +38.566%]
  • 🟩 execution_time [-25.930ms; -20.220ms] or [-11.564%; -9.017%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.288%; +105.304%]
  • 🟥 throughput [-154304.688op/s; -138293.618op/s] or [-22.171%; -19.870%]

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

  • 🟩 throughput [+8219.320op/s; +10961.109op/s] or [+6.548%; +8.732%]

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

  • 🟩 throughput [+474801.672op/s; +486888.585op/s] or [+15.832%; +16.235%]

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

  • 🟩 execution_time [-17.979ms; -13.587ms] or [-8.288%; -6.263%]

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

  • 🟥 execution_time [+299.501ms; +300.322ms] or [+149.650%; +150.061%]

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

  • 🟥 execution_time [+300.806ms; +304.513ms] or [+151.697%; +153.567%]

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

  • 🟥 execution_time [+300.668ms; +303.710ms] or [+151.453%; +152.986%]

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

  • 🟥 execution_time [+297.781ms; +298.540ms] or [+146.258%; +146.631%]

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

  • 🟥 execution_time [+295.772ms; +298.790ms] or [+144.592%; +146.067%]

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

  • 🟥 execution_time [+299.923ms; +301.255ms] or [+149.901%; +150.567%]

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

  • 🟥 execution_time [+23.876µs; +47.529µs] or [+7.622%; +15.174%]
  • 🟥 throughput [-441.087op/s; -242.080op/s] or [-13.750%; -7.546%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.965ms; +300.786ms] or [+149.713%; +150.123%]

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

  • 🟥 execution_time [+400.838ms; +406.890ms] or [+435.527%; +442.102%]
  • 🟩 throughput [+912.738op/s; +1081.992op/s] or [+7.500%; +8.891%]

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

  • 🟥 execution_time [+370.403ms; +374.227ms] or [+281.244%; +284.147%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+340.688ms; +394.324ms] or [+156.645%; +181.307%]
  • 🟥 throughput [-589.444op/s; -537.004op/s] or [-53.409%; -48.658%]

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

  • unstable execution_time [+205.439ms; +338.689ms] or [+87.549%; +144.335%]
  • 🟥 throughput [-675.906op/s; -592.072op/s] or [-45.083%; -39.491%]

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

  • 🟥 execution_time [+330.375ms; +339.231ms] or [+197.603%; +202.900%]
  • 🟥 throughput [-389.493op/s; -352.250op/s] or [-27.120%; -24.527%]

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

  • unstable execution_time [-231.177µs; -26.642µs] or [-12.385%; -1.427%]
  • unstable throughput [+23.739op/s; +150.044op/s] or [+4.431%; +28.007%]

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

  • 🟩 execution_time [-168.773µs; -110.128µs] or [-8.549%; -5.579%]
  • 🟩 throughput [+32.426op/s; +47.679op/s] or [+6.401%; +9.412%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+306.336ms; +307.737ms] or [+154.265%; +154.971%]

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

  • 🟥 execution_time [+302.605ms; +304.147ms] or [+151.636%; +152.408%]

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

  • 🟥 execution_time [+299.459ms; +303.001ms] or [+150.435%; +152.215%]
  • 🟩 throughput [+30292.004op/s; +38766.485op/s] or [+6.381%; +8.166%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+298.636ms; +300.372ms] or [+149.965%; +150.837%]

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

  • 🟥 execution_time [+299.259ms; +300.879ms] or [+147.970%; +148.771%]

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

  • 🟥 execution_time [+303.736ms; +308.091ms] or [+153.946%; +156.154%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+303.282ms; +307.245ms] or [+152.220%; +154.209%]

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

  • 🟥 execution_time [+299.115ms; +302.050ms] or [+149.081%; +150.544%]
  • 🟩 throughput [+48226.240op/s; +53891.419op/s] or [+9.576%; +10.701%]

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

  • 🟥 execution_time [+300.893ms; +303.220ms] or [+149.692%; +150.849%]

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

  • 🟩 execution_time [-15.905ms; -12.239ms] or [-7.396%; -5.691%]

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

  • unstable execution_time [+9.470µs; +64.229µs] or [+2.339%; +15.865%]

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

  • 🟩 allocated_mem [-20.519KB; -20.497KB] or [-7.485%; -7.477%]
  • unstable execution_time [-41.108µs; +17.678µs] or [-8.125%; +3.494%]
  • unstable throughput [-55.755op/s; +154.255op/s] or [-2.782%; +7.697%]

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

  • 🟩 allocated_mem [-18.595KB; -18.576KB] or [-6.779%; -6.772%]
  • unstable execution_time [-41.598µs; +21.729µs] or [-7.209%; +3.765%]
  • unstable throughput [-52.223op/s; +123.702op/s] or [-2.984%; +7.067%]

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

  • unstable execution_time [+6.807µs; +12.532µs] or [+16.090%; +29.621%]
  • 🟥 throughput [-5193.774op/s; -3136.216op/s] or [-21.864%; -13.202%]

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

  • unstable execution_time [-14.158µs; -5.440µs] or [-21.965%; -8.440%]
  • unstable throughput [+1522.768op/s; +3399.727op/s] or [+9.343%; +20.858%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+302.768ms; +304.334ms] or [+153.036%; +153.827%]

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

  • 🟥 execution_time [+302.221ms; +305.472ms] or [+153.830%; +155.484%]

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

  • 🟥 execution_time [+301.253ms; +304.235ms] or [+150.814%; +152.307%]

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

  • 🟩 throughput [+27096.564op/s; +36987.337op/s] or [+5.129%; +7.001%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+299.656ms; +301.763ms] or [+149.352%; +150.402%]

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

  • 🟥 execution_time [+300.623ms; +302.227ms] or [+150.958%; +151.764%]

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

  • 🟥 execution_time [+303.675ms; +306.745ms] or [+154.005%; +155.561%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.973ms; +300.794ms] or [+149.628%; +150.037%]
  • 🟩 throughput [+60985630.568op/s; +61347251.726op/s] or [+44.414%; +44.677%]

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

  • 🟥 execution_time [+421.278ms; +425.674ms] or [+523.934%; +529.401%]

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

  • 🟥 execution_time [+299.510ms; +300.692ms] or [+149.389%; +149.978%]

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

  • 🟩 throughput [+99359.206op/s; +108439.123op/s] or [+9.277%; +10.125%]

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

  • 🟩 throughput [+44566.726op/s; +64650.339op/s] or [+5.159%; +7.483%]

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

  • 🟩 throughput [+108412.499op/s; +137774.083op/s] or [+8.391%; +10.664%]

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

  • 🟩 throughput [+81082.634op/s; +90080.979op/s] or [+8.053%; +8.946%]

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

  • 🟩 throughput [+52697.364op/s; +57308.007op/s] or [+9.569%; +10.406%]

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

  • 🟩 throughput [+23497.332op/s; +33270.578op/s] or [+5.259%; +7.447%]

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

  • 🟩 throughput [+89519.109op/s; +107654.696op/s] or [+10.002%; +12.028%]

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.ActivityBenchmark.StartStopWithChild netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark 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.OptimizedCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0
  • 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

dd-trace-dotnet-ci-bot Bot commented May 26, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8691) 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.04 ± (73.09 - 73.59) ms72.70 ± (72.63 - 72.93) ms-0.5%
.NET Framework 4.8 - Bailout
duration77.26 ± (77.13 - 77.48) ms76.53 ± (76.43 - 76.76) ms-0.9%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1100.37 ± (1101.40 - 1109.12) ms1106.43 ± (1107.42 - 1114.83) ms+0.6%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.40 ± (22.36 - 22.45) ms22.41 ± (22.37 - 22.45) ms+0.0%✅⬆️
process.time_to_main_ms84.58 ± (84.37 - 84.79) ms84.17 ± (83.96 - 84.39) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.94 ± (10.94 - 10.94) MB10.93 ± (10.92 - 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.40 ± (22.35 - 22.45) ms22.82 ± (22.77 - 22.87) ms+1.9%✅⬆️
process.time_to_main_ms86.47 ± (86.21 - 86.72) ms88.47 ± (88.21 - 88.74) ms+2.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.97 ± (10.97 - 10.98) MB10.96 ± (10.95 - 10.96) MB-0.2%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms215.42 ± (214.46 - 216.38) ms213.34 ± (212.41 - 214.26) ms-1.0%
process.time_to_main_ms545.40 ± (544.08 - 546.72) ms541.16 ± (539.84 - 542.48) ms-0.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.61 ± (48.58 - 48.65) MB48.63 ± (48.59 - 48.67) MB+0.0%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms21.37 ± (21.32 - 21.42) ms21.61 ± (21.55 - 21.67) ms+1.1%✅⬆️
process.time_to_main_ms75.17 ± (74.90 - 75.44) ms75.77 ± (75.48 - 76.06) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.64 ± (10.64 - 10.64) MB10.63 ± (10.63 - 10.63) MB-0.1%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.34 ± (21.29 - 21.39) ms21.22 ± (21.17 - 21.27) ms-0.5%
process.time_to_main_ms76.38 ± (76.11 - 76.66) ms75.35 ± (75.14 - 75.56) ms-1.4%
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.74) MB-0.1%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms371.76 ± (369.66 - 373.86) ms371.69 ± (369.81 - 373.58) ms-0.0%
process.time_to_main_ms549.75 ± (548.52 - 550.98) ms551.76 ± (550.36 - 553.17) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed50.08 ± (50.05 - 50.10) MB50.07 ± (50.04 - 50.09) MB-0.0%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.30 ± (19.26 - 19.34) ms19.80 ± (19.74 - 19.86) ms+2.6%✅⬆️
process.time_to_main_ms72.26 ± (72.08 - 72.44) ms75.19 ± (74.84 - 75.54) ms+4.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.68 ± (7.67 - 7.68) MB7.68 ± (7.68 - 7.69) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.64 ± (19.59 - 19.69) ms19.74 ± (19.68 - 19.80) ms+0.5%✅⬆️
process.time_to_main_ms75.89 ± (75.62 - 76.16) ms76.48 ± (76.20 - 76.77) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.73 ± (7.73 - 7.74) MB7.73 ± (7.72 - 7.73) MB-0.1%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms300.66 ± (298.58 - 302.74) ms294.86 ± (292.55 - 297.17) ms-1.9%
process.time_to_main_ms496.31 ± (495.25 - 497.38) ms499.65 ± (498.61 - 500.69) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.99 ± (36.96 - 37.02) MB36.99 ± (36.96 - 37.02) MB-0.0%
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
duration197.85 ± (197.78 - 198.69) ms197.91 ± (197.54 - 198.44) ms+0.0%✅⬆️
.NET Framework 4.8 - Bailout
duration202.02 ± (201.80 - 202.40) ms200.77 ± (200.34 - 201.19) ms-0.6%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1189.18 ± (1188.87 - 1194.60) ms1195.97 ± (1194.15 - 1201.01) ms+0.6%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms193.55 ± (193.18 - 193.92) ms192.29 ± (191.82 - 192.76) ms-0.7%
process.time_to_main_ms83.96 ± (83.68 - 84.24) ms82.75 ± (82.48 - 83.02) ms-1.4%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.09 ± (16.06 - 16.11) MB16.03 ± (16.01 - 16.06) MB-0.3%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (19 - 20)-0.3%
.NET Core 3.1 - Bailout
process.internal_duration_ms193.48 ± (192.98 - 193.99) ms192.64 ± (192.13 - 193.14) ms-0.4%
process.time_to_main_ms85.21 ± (84.93 - 85.49) ms84.51 ± (84.25 - 84.77) ms-0.8%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.09 ± (16.06 - 16.11) MB16.17 ± (16.15 - 16.20) MB+0.5%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (20 - 21)-0.3%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms383.99 ± (382.85 - 385.13) ms385.34 ± (383.99 - 386.69) ms+0.4%✅⬆️
process.time_to_main_ms533.63 ± (532.55 - 534.70) ms534.23 ± (533.10 - 535.36) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed57.43 ± (57.26 - 57.61) MB57.58 ± (57.41 - 57.74) MB+0.2%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-0.0%
.NET 6 - Baseline
process.internal_duration_ms197.36 ± (196.86 - 197.86) ms197.20 ± (196.75 - 197.65) ms-0.1%
process.time_to_main_ms72.10 ± (71.86 - 72.35) ms72.33 ± (72.07 - 72.59) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.33 ± (16.30 - 16.35) MB16.34 ± (16.25 - 16.42) MB+0.1%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-1.9%
.NET 6 - Bailout
process.internal_duration_ms195.68 ± (195.18 - 196.19) ms196.67 ± (196.31 - 197.03) ms+0.5%✅⬆️
process.time_to_main_ms72.90 ± (72.66 - 73.13) ms73.24 ± (73.04 - 73.43) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.41 ± (16.38 - 16.43) MB16.47 ± (16.44 - 16.50) MB+0.4%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.1%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms585.61 ± (582.88 - 588.33) ms586.54 ± (584.06 - 589.01) ms+0.2%✅⬆️
process.time_to_main_ms541.56 ± (540.30 - 542.81) ms541.73 ± (540.51 - 542.95) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.24 ± (61.13 - 61.36) MB61.15 ± (61.03 - 61.26) MB-0.2%
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)+0.4%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms194.75 ± (194.32 - 195.17) ms194.77 ± (194.32 - 195.22) ms+0.0%✅⬆️
process.time_to_main_ms71.84 ± (71.54 - 72.13) ms71.68 ± (71.41 - 71.96) ms-0.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.71 ± (11.69 - 11.73) MB11.72 ± (11.70 - 11.75) MB+0.1%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 19)18 ± (18 - 18)-0.5%
.NET 8 - Bailout
process.internal_duration_ms193.50 ± (192.98 - 194.01) ms194.35 ± (194.03 - 194.66) ms+0.4%✅⬆️
process.time_to_main_ms72.53 ± (72.30 - 72.76) ms72.52 ± (72.33 - 72.72) ms-0.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.76 ± (11.73 - 11.78) MB11.76 ± (11.74 - 11.78) MB+0.0%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.6%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms510.72 ± (508.46 - 512.99) ms512.85 ± (510.30 - 515.41) ms+0.4%✅⬆️
process.time_to_main_ms490.35 ± (489.58 - 491.13) ms490.39 ± (489.35 - 491.44) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.65 ± (50.62 - 50.69) MB50.65 ± (50.61 - 50.69) MB+0.0%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 30)29 ± (29 - 29)-1.0%
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 (8691) - mean (73ms)  : 70, 75
    master - mean (73ms)  : 69, 77

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

    section CallTarget+Inlining+NGEN
    This PR (8691) - mean (1,111ms)  : 1058, 1164
    master - mean (1,105ms)  : 1049, 1162

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 (8691) - mean (113ms)  : 110, 117
    master - mean (114ms)  : 110, 118

    section Bailout
    This PR (8691) - mean (119ms)  : 113, 124
    master - mean (116ms)  : 113, 119

    section CallTarget+Inlining+NGEN
    This PR (8691) - mean (794ms)  : 771, 816
    master - mean (797ms)  : 774, 820

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8691) - mean (104ms)  : 98, 110
    master - mean (103ms)  : 98, 108

    section Bailout
    This PR (8691) - mean (103ms)  : 99, 107
    master - mean (104ms)  : 99, 110

    section CallTarget+Inlining+NGEN
    This PR (8691) - mean (957ms)  : 921, 994
    master - mean (952ms)  : 920, 985

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8691) - mean (103ms)  : 96, 110
    master - mean (99ms)  : 96, 102

    section Bailout
    This PR (8691) - mean (104ms)  : 98, 110
    master - mean (103ms)  : 99, 108

    section CallTarget+Inlining+NGEN
    This PR (8691) - mean (826ms)  : 790, 863
    master - mean (825ms)  : 792, 859

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 (8691) - mean (198ms)  : 192, 204
    master - mean (198ms)  : 193, 203

    section Bailout
    This PR (8691) - mean (201ms)  : 197, 205
    master - mean (202ms)  : 199, 205

    section CallTarget+Inlining+NGEN
    This PR (8691) - mean (1,198ms)  : 1148, 1247
    master - mean (1,192ms)  : 1153, 1230

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 (8691) - mean (284ms)  : 275, 293
    master - mean (286ms)  : 282, 291

    section Bailout
    This PR (8691) - mean (286ms)  : 278, 294
    master - mean (288ms)  : 282, 294

    section CallTarget+Inlining+NGEN
    This PR (8691) - mean (959ms)  : 940, 977
    master - mean (956ms)  : 938, 974

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8691) - mean (278ms)  : 271, 285
    master - mean (278ms)  : 273, 283

    section Bailout
    This PR (8691) - mean (278ms)  : 274, 282
    master - mean (277ms)  : 270, 285

    section CallTarget+Inlining+NGEN
    This PR (8691) - mean (1,157ms)  : 1130, 1185
    master - mean (1,159ms)  : 1129, 1189

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8691) - mean (277ms)  : 270, 283
    master - mean (277ms)  : 271, 282

    section Bailout
    This PR (8691) - mean (277ms)  : 273, 281
    master - mean (276ms)  : 269, 284

    section CallTarget+Inlining+NGEN
    This PR (8691) - mean (1,035ms)  : 992, 1078
    master - mean (1,035ms)  : 991, 1078

Loading

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates SymDB symbol uploads to stream payloads directly into the request body (including streaming gzip output) to reduce intermediate allocations/copies, while preserving backend-sensitive multipart behavior via new wire-format tests.

Changes:

  • Add a streaming ISymbolUploadApi.SendBatchAsync(Func<Stream, Task>, ...) overload and switch SymbolsUploader to stream StringBuilder content as UTF-8 instead of materializing a full string/byte[].
  • Rework SymbolUploadApi multipart writing to manually stream the file part, count the bytes written, then emit the event part with the computed attachmentSize.
  • Add multipart wire-format tests for compressed and uncompressed SymDB uploads (part order, headers, decompression, and event metadata validation).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tracer/test/Datadog.Trace.Tests/Debugger/SymbolsTests/SymbolUploaderTest.cs Extends mock API to accept the new streaming upload overload.
tracer/test/Datadog.Trace.Tests/Debugger/SymbolsTests/SymbolUploadApiTests.cs Adds multipart wire-format tests for streamed SymDB uploads (gzip and non-gzip).
tracer/src/Datadog.Trace/Debugger/Upload/SymbolUploadApi.cs Implements streamed multipart upload (manual multipart writing + byte counting for attachmentSize).
tracer/src/Datadog.Trace/Debugger/Upload/ISymbolUploadApi.cs Adds streaming upload overload to the SymDB upload API contract.
tracer/src/Datadog.Trace/Debugger/Symbols/SymbolsUploader.cs Switches symbol payload sending to a streaming writer to avoid large allocations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tracer/src/Datadog.Trace/Debugger/Upload/SymbolUploadApi.cs
@dudikeleti
dudikeleti marked this pull request as ready for review May 27, 2026 08:41
@dudikeleti
dudikeleti requested review from a team as code owners May 27, 2026 08:41
@dudikeleti
dudikeleti requested a review from Copilot May 27, 2026 08:41

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c13071ad34

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

Comment thread tracer/src/Datadog.Trace/Debugger/Upload/SymbolUploadApi.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@dudikeleti dudikeleti changed the title Dudik/symdb/stream upload [SymDB] Stream SymDB payload May 27, 2026
@dudikeleti
dudikeleti removed the request for review from P403n1x87 May 27, 2026 09:06
@dudikeleti
dudikeleti force-pushed the dudik/symdb/stream-upload branch from c13071a to c32c7f7 Compare May 27, 2026 09:35
@dudikeleti
dudikeleti requested a review from a team as a code owner May 27, 2026 09:35
@dudikeleti
dudikeleti enabled auto-merge (squash) May 27, 2026 09:36

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

Comment thread tracer/src/Datadog.Trace/Debugger/Symbols/SymbolsUploader.cs
Comment thread tracer/src/Datadog.Trace/Debugger/Symbols/SymbolsUploader.cs Outdated
Comment thread tracer/test/Datadog.Trace.Tests/Agent/DiscoveryServiceMock.cs Outdated
Comment on lines +32 to +37
private static readonly byte[] InitialBoundaryBytes = EncodingHelpers.Utf8NoBom.GetBytes("--" + DatadogHttpValues.Boundary + DatadogHttpValues.CrLf);
private static readonly byte[] BoundaryBytes = EncodingHelpers.Utf8NoBom.GetBytes(DatadogHttpValues.CrLf + "--" + DatadogHttpValues.Boundary + DatadogHttpValues.CrLf);
private static readonly byte[] FinalBoundaryBytes = EncodingHelpers.Utf8NoBom.GetBytes(DatadogHttpValues.CrLf + "--" + DatadogHttpValues.Boundary + "--" + DatadogHttpValues.CrLf);
private static readonly byte[] FileJsonHeaderBytes = EncodingHelpers.Utf8NoBom.GetBytes("Content-Type: " + MimeTypes.Json + DatadogHttpValues.CrLf + "Content-Disposition: form-data; name=\"file\"; filename=\"file.json\"" + DatadogHttpValues.CrLf + DatadogHttpValues.CrLf);
private static readonly byte[] FileGzipHeaderBytes = EncodingHelpers.Utf8NoBom.GetBytes("Content-Type: " + MimeTypes.Gzip + DatadogHttpValues.CrLf + "Content-Disposition: form-data; name=\"file\"; filename=\"file.gz\"" + DatadogHttpValues.CrLf + DatadogHttpValues.CrLf);
private static readonly byte[] EventHeaderBytes = EncodingHelpers.Utf8NoBom.GetBytes("Content-Type: " + MimeTypes.Json + DatadogHttpValues.CrLf + "Content-Disposition: form-data; name=\"event\"; filename=\"event.json\"" + DatadogHttpValues.CrLf + DatadogHttpValues.CrLf);

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.

We should use ReadonlySpan<byte> for these constants instead, to avoid allocation and to reduce startup overhead 🙂

e.g. #8487

@dudikeleti dudikeleti May 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

de42bdf

I had your pr in mind 🙂 I wasn’t sure at first if it was better here becuase implementation tradeoff (It adds complexity), but definitely worth to reduce startup overhead

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.

:/ it looks like you're copying these back into a buffer in that commit? That seems to defeat the purpose of using ReadonlySpan<byte> here 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, it's a startup time allocation vs rutime overhead :( that why I wrote that "I wasn’t sure" but maybe startup time is more important here, the new overhead is one shared array per upload. Anyway, I plan to make some changes so I might avoid this new copy later.

@dudikeleti dudikeleti May 28, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I changed this to avoid the per-upload copy. We have now the bytes arrays again but we avoid allocating them till the first symdb upload.

a87a646

Comment on lines +63 to +64
_discoveryCallback = OnDiscoveryServiceChanged;
discoveryService.SubscribeToChanges(_discoveryCallback);

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.

This is just an unnecessary field I think? You can still unsubscribe later with the method group?

Suggested change
_discoveryCallback = OnDiscoveryServiceChanged;
discoveryService.SubscribeToChanges(_discoveryCallback);
discoveryService.SubscribeToChanges(OnDiscoveryServiceChanged);

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.

Unless you can't, in which case this is a bug we have elsewhere that we should fix 😅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We can do that, I kept this field only because RemoveSubscription(), but i don't have to

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.

We can do that, I kept this field only because RemoveSubscription(), but i don't have to

But can't you do this?

discoveryService.RemoveSubscription(OnDiscoveryServiceChanged);

That's what I meant by this: 😄

Unless you can't, in which case this is a bug we have elsewhere that we should fix 😅

@dudikeleti dudikeleti May 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But can't you do this?

yes if you want😅
react with 👍🏼 or 👎🏼 (the current code doesnt bother me, but I'm fine also with removing it. its one field vs allocate the callback when we want to unsubscribe)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed 5e5b21b

Comment thread tracer/src/Datadog.Trace/Debugger/Upload/SymbolUploadApi.cs Outdated
Comment thread tracer/src/Datadog.Trace/Debugger/Upload/SymbolUploadApi.cs Outdated
Comment thread tracer/src/Datadog.Trace/Debugger/Upload/SymbolUploadApi.cs
Comment thread tracer/test/Datadog.Trace.Tests/Debugger/SymbolsTests/SymbolUploadApiTests.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Comment thread tracer/src/Datadog.Trace/Debugger/Upload/SymbolUploadApi.cs Outdated
Comment thread tracer/src/Datadog.Trace/Debugger/Upload/SymbolUploadApi.cs Outdated
@dudikeleti
dudikeleti disabled auto-merge May 27, 2026 22:41
@dudikeleti
dudikeleti force-pushed the dudik/symdb/stream-upload branch from 5e5b21b to a87a646 Compare May 28, 2026 09:30
@dudikeleti
dudikeleti enabled auto-merge (squash) May 28, 2026 09: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, it might be worth double checking your benchmarks, just before merge, given there were quite a few changes afterwards! 🙂

@dudikeleti
dudikeleti merged commit 547e315 into master May 28, 2026
141 checks passed
@dudikeleti
dudikeleti deleted the dudik/symdb/stream-upload branch May 28, 2026 12:09
@github-actions github-actions Bot added this to the vNext-v3 milestone May 28, 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.

4 participants