Skip to content

Convert Encoding.Utf8.GetBytes calls to static constants using UTF8 string literals#8487

Merged
andrewlock merged 1 commit intomasterfrom
andrew/encode-utf-8-at-buid-time
Apr 27, 2026
Merged

Convert Encoding.Utf8.GetBytes calls to static constants using UTF8 string literals#8487
andrewlock merged 1 commit intomasterfrom
andrew/encode-utf-8-at-buid-time

Conversation

@andrewlock
Copy link
Copy Markdown
Member

Summary of changes

Convert Encoding.Utf8.GetBytes calls to static constants using UTF8 string literals

Reason for change

After moving our vendored Span<T> implementation into the System namespace, various optimizations open up to us, including using UTF-8 string literals, to encode strings to UTF-8 at compile time instead of at runtime. By combing with static ReadOnlySpan<byte> properties, these also become zero allocation, so we get reduced overall memory usage as well as better startup time

Implementation details

Replace the following with utf8 string literals:

  • StringEncoding.UTF8.GetBytes
  • Encoding.UTF8.GetBytes
  • EncodingHelpers.UTF8NoBom.GetBytes

Test coverage

All covered by existing tests

Other details

Depends on a stack updating our vendored system code

@andrewlock andrewlock added type:refactor type:performance Performance, speed, latency, resource usage (CPU, memory) labels Apr 20, 2026
@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Apr 20, 2026

Benchmarks

Benchmark execution time: 2026-04-27 09:08:45

Comparing candidate commit f3d2140 in PR branch andrew/encode-utf-8-at-buid-time with baseline commit 55b7898 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 0 unstable metrics, 57 known flaky benchmarks, 30 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0

  • 🟩 throughput [+9448.141op/s; +11780.193op/s] or [+7.942%; +9.902%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+313.960ms; +318.796ms] or [+155.798%; +158.198%]
  • 🟥 throughput [-45.169op/s; -40.843op/s] or [-8.127%; -7.348%]

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

  • 🟥 execution_time [+379.508ms; +381.419ms] or [+299.835%; +301.345%]
  • 🟩 throughput [+94.434op/s; +99.117op/s] or [+12.451%; +13.068%]

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

  • 🟥 execution_time [+393.696ms; +397.591ms] or [+348.406%; +351.853%]

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

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.529%; +27.541%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.977%; +9.987%]
  • 🟩 execution_time [-16.622ms; -12.438ms] or [-7.763%; -5.809%]

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

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

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

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.746%; +105.759%]
  • 🟥 throughput [-270352.858op/s; -266557.261op/s] or [-27.604%; -27.217%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.558%; +38.566%]
  • 🟩 execution_time [-25.334ms; -20.483ms] or [-11.298%; -9.134%]
  • 🟥 throughput [-83700.168op/s; -61057.523op/s] or [-8.942%; -6.523%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.292%; +105.304%]
  • 🟥 throughput [-137397.524op/s; -120741.906op/s] or [-19.741%; -17.348%]

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

  • 🟩 throughput [+10085.131op/s; +13081.087op/s] or [+6.417%; +8.323%]

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

  • 🟩 throughput [+412987.148op/s; +437745.656op/s] or [+13.771%; +14.596%]

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

  • 🟩 execution_time [-19.201ms; -14.799ms] or [-8.851%; -6.822%]
  • 🟩 throughput [+167212.746op/s; +221839.223op/s] or [+6.637%; +8.805%]

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

  • 🟥 execution_time [+299.616ms; +300.267ms] or [+149.708%; +150.033%]

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

  • 🟥 execution_time [+299.353ms; +302.537ms] or [+150.965%; +152.570%]

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

  • 🟥 execution_time [+299.292ms; +301.749ms] or [+150.760%; +151.998%]

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

  • 🟥 execution_time [+297.100ms; +297.908ms] or [+145.924%; +146.321%]

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

  • 🟥 execution_time [+296.742ms; +299.708ms] or [+145.066%; +146.516%]

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

  • 🟥 execution_time [+301.905ms; +303.583ms] or [+150.892%; +151.731%]

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

  • 🟥 execution_time [+20.959µs; +44.525µs] or [+6.691%; +14.214%]
  • 🟥 throughput [-416.333op/s; -217.997op/s] or [-12.978%; -6.796%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.438ms; +300.171ms] or [+149.450%; +149.816%]

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

  • unstable execution_time [+378.310ms; +411.194ms] or [+411.049%; +446.780%]
  • 🟩 throughput [+1048.759op/s; +1188.469op/s] or [+8.618%; +9.766%]

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

  • unstable execution_time [+297.790ms; +332.638ms] or [+226.109%; +252.569%]
  • 🟩 throughput [+646.892op/s; +849.600op/s] or [+6.262%; +8.225%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+330.348ms; +375.423ms] or [+151.891%; +172.616%]
  • 🟥 throughput [-591.635op/s; -555.058op/s] or [-53.608%; -50.294%]

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

  • unstable execution_time [+206.804ms; +340.036ms] or [+88.131%; +144.909%]
  • 🟥 throughput [-671.794op/s; -588.329op/s] or [-44.809%; -39.242%]

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

  • 🟥 execution_time [+342.041ms; +351.635ms] or [+204.580%; +210.318%]
  • 🟥 throughput [-400.675op/s; -364.972op/s] or [-27.898%; -25.412%]

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

  • 🟩 throughput [+47.670op/s; +80.943op/s] or [+5.140%; +8.727%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+302.189ms; +303.716ms] or [+152.177%; +152.946%]

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

  • 🟥 execution_time [+301.639ms; +303.324ms] or [+151.152%; +151.996%]

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

  • 🟥 execution_time [+302.114ms; +305.299ms] or [+151.769%; +153.369%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+302.660ms; +304.133ms] or [+151.986%; +152.726%]

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

  • 🟥 execution_time [+298.986ms; +301.063ms] or [+147.835%; +148.862%]

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

  • 🟥 execution_time [+305.244ms; +308.806ms] or [+154.711%; +156.516%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+299.847ms; +301.074ms] or [+150.496%; +151.112%]

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

  • 🟥 execution_time [+300.047ms; +303.071ms] or [+149.546%; +151.053%]
  • 🟩 throughput [+43068.548op/s; +49073.726op/s] or [+8.552%; +9.744%]

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

  • 🟥 execution_time [+298.987ms; +301.521ms] or [+148.743%; +150.004%]

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

  • 🟩 execution_time [-16.437ms; -12.800ms] or [-7.643%; -5.952%]

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

  • unstable execution_time [+9.223µs; +49.762µs] or [+2.278%; +12.292%]

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

  • 🟩 allocated_mem [-19.664KB; -19.643KB] or [-7.173%; -7.165%]
  • unstable execution_time [-43.221µs; +8.176µs] or [-8.542%; +1.616%]

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

  • 🟥 execution_time [+6.415µs; +10.602µs] or [+15.163%; +25.059%]
  • 🟥 throughput [-4744.744op/s; -2966.823op/s] or [-19.974%; -12.489%]

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

  • unstable execution_time [-13.670µs; -6.370µs] or [-21.208%; -9.884%]
  • 🟩 throughput [+1645.610op/s; +3190.144op/s] or [+10.096%; +19.573%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+302.237ms; +303.324ms] or [+152.767%; +153.317%]

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

  • 🟥 execution_time [+303.269ms; +305.522ms] or [+154.363%; +155.510%]

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

  • 🟥 execution_time [+299.682ms; +302.050ms] or [+150.028%; +151.214%]

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

  • 🟩 throughput [+28064.549op/s; +32273.474op/s] or [+5.312%; +6.109%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+300.718ms; +302.681ms] or [+149.881%; +150.859%]

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

  • 🟥 execution_time [+299.498ms; +300.988ms] or [+150.394%; +151.142%]

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

  • 🟥 execution_time [+303.642ms; +306.393ms] or [+153.988%; +155.383%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.151ms; +300.164ms] or [+149.218%; +149.723%]
  • 🟩 throughput [+61071351.289op/s; +61324201.313op/s] or [+44.476%; +44.660%]

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

  • 🟥 execution_time [+415.618ms; +422.339ms] or [+516.895%; +525.254%]
  • 🟩 throughput [+1011.709op/s; +1181.095op/s] or [+7.821%; +9.130%]

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

  • 🟥 execution_time [+299.336ms; +300.257ms] or [+149.302%; +149.761%]

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

  • 🟩 throughput [+95910.351op/s; +103558.923op/s] or [+8.955%; +9.669%]

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

  • 🟩 throughput [+51954.170op/s; +70984.630op/s] or [+6.014%; +8.216%]

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

  • 🟩 throughput [+67623.447op/s; +100346.438op/s] or [+5.234%; +7.767%]

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

  • 🟩 throughput [+61615.820op/s; +71937.155op/s] or [+6.119%; +7.145%]

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

  • 🟩 throughput [+50427.330op/s; +55653.476op/s] or [+9.157%; +10.106%]

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

  • 🟩 throughput [+85287.228op/s; +105378.483op/s] or [+9.529%; +11.773%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark 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 netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@andrewlock andrewlock marked this pull request as ready for review April 20, 2026 15:54
@andrewlock andrewlock requested review from a team as code owners April 20, 2026 15:54
Copy link
Copy Markdown

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

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: b34d5dc6fb

ℹ️ 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/Ci/Agent/MessagePack/CIEventMessagePackFormatter.cs Outdated
@andrewlock andrewlock force-pushed the andrew/update-tag-generator branch from eca7df4 to 54730c9 Compare April 21, 2026 10:19
@andrewlock andrewlock requested review from a team as code owners April 21, 2026 10:19
@andrewlock andrewlock force-pushed the andrew/encode-utf-8-at-buid-time branch 2 times, most recently from cd7946c to 6e4930c Compare April 21, 2026 10:26
@andrewlock andrewlock force-pushed the andrew/update-tag-generator branch from 54730c9 to 3f06600 Compare April 24, 2026 07:14
@andrewlock andrewlock force-pushed the andrew/encode-utf-8-at-buid-time branch from 6e4930c to 5851cc5 Compare April 24, 2026 07:14
@andrewlock andrewlock force-pushed the andrew/update-tag-generator branch from 3f06600 to 14245b2 Compare April 24, 2026 08:22
@andrewlock andrewlock force-pushed the andrew/encode-utf-8-at-buid-time branch from 5851cc5 to 931e25a Compare April 24, 2026 08:22
@andrewlock andrewlock force-pushed the andrew/update-tag-generator branch from 14245b2 to fa83d95 Compare April 24, 2026 08:26
@andrewlock andrewlock force-pushed the andrew/encode-utf-8-at-buid-time branch from 931e25a to c57dd03 Compare April 24, 2026 08:26
@andrewlock andrewlock force-pushed the andrew/update-tag-generator branch from fa83d95 to 787ab49 Compare April 24, 2026 11:31
@andrewlock andrewlock force-pushed the andrew/encode-utf-8-at-buid-time branch from c57dd03 to b895f2b Compare April 24, 2026 11:31
Copy link
Copy Markdown
Member

@lucaspimentel lucaspimentel left a comment

Choose a reason for hiding this comment

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

Nice!

@andrewlock andrewlock force-pushed the andrew/update-tag-generator branch from 787ab49 to 40b0f3c Compare April 24, 2026 15:58
Base automatically changed from andrew/update-tag-generator to master April 24, 2026 17:22
@dd-trace-dotnet-ci-bot
Copy link
Copy Markdown

dd-trace-dotnet-ci-bot Bot commented Apr 24, 2026

Execution-Time Benchmarks Report ⏱️

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

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration74.50 ± (74.49 - 75.05) ms72.74 ± (72.66 - 73.03) ms-2.4%
.NET Framework 4.8 - Bailout
duration77.29 ± (77.27 - 77.68) ms77.24 ± (77.01 - 77.43) ms-0.1%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1083.01 ± (1083.52 - 1091.35) ms1084.32 ± (1082.58 - 1088.91) ms+0.1%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.63 ± (22.57 - 22.69) ms22.53 ± (22.49 - 22.57) ms-0.4%
process.time_to_main_ms85.77 ± (85.49 - 86.04) ms84.99 ± (84.78 - 85.21) ms-0.9%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.91 ± (10.91 - 10.92) MB10.92 ± (10.91 - 10.92) MB+0.0%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.41 ± (22.37 - 22.46) ms22.88 ± (22.83 - 22.94) ms+2.1%✅⬆️
process.time_to_main_ms85.85 ± (85.63 - 86.07) ms89.10 ± (88.75 - 89.44) ms+3.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.93 ± (10.92 - 10.94) MB10.94 ± (10.94 - 10.95) MB+0.1%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms211.46 ± (210.48 - 212.43) ms214.45 ± (213.62 - 215.28) ms+1.4%✅⬆️
process.time_to_main_ms531.44 ± (530.11 - 532.76) ms530.50 ± (529.07 - 531.92) ms-0.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.04 ± (48.01 - 48.06) MB48.01 ± (47.98 - 48.03) MB-0.1%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-1.1%
.NET 6 - Baseline
process.internal_duration_ms21.28 ± (21.24 - 21.32) ms21.54 ± (21.48 - 21.60) ms+1.2%✅⬆️
process.time_to_main_ms73.76 ± (73.55 - 73.96) ms76.00 ± (75.68 - 76.33) ms+3.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.61 ± (10.61 - 10.62) MB10.62 ± (10.62 - 10.63) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.15 ± (21.12 - 21.19) ms21.39 ± (21.33 - 21.45) ms+1.1%✅⬆️
process.time_to_main_ms75.02 ± (74.82 - 75.22) ms76.83 ± (76.54 - 77.12) ms+2.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.73 ± (10.73 - 10.73) MB10.74 ± (10.74 - 10.75) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms381.49 ± (379.10 - 383.88) ms381.92 ± (380.09 - 383.75) ms+0.1%✅⬆️
process.time_to_main_ms528.59 ± (526.91 - 530.26) ms532.07 ± (530.77 - 533.38) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.37 ± (49.33 - 49.40) MB49.42 ± (49.39 - 49.44) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.2%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.93 ± (19.87 - 20.00) ms19.56 ± (19.52 - 19.59) ms-1.9%
process.time_to_main_ms75.55 ± (75.24 - 75.86) ms73.17 ± (73.01 - 73.32) ms-3.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.65 ± (7.65 - 7.66) MB7.65 ± (7.64 - 7.66) MB-0.0%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.50 ± (19.46 - 19.53) ms19.97 ± (19.91 - 20.03) ms+2.4%✅⬆️
process.time_to_main_ms74.47 ± (74.29 - 74.65) ms76.75 ± (76.45 - 77.04) ms+3.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.70 ± (7.70 - 7.71) MB7.70 ± (7.70 - 7.71) MB+0.0%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms301.07 ± (298.77 - 303.38) ms301.12 ± (298.84 - 303.41) ms+0.0%✅⬆️
process.time_to_main_ms494.53 ± (493.19 - 495.87) ms491.54 ± (490.12 - 492.96) ms-0.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.51 ± (36.48 - 36.54) MB36.51 ± (36.48 - 36.53) MB-0.0%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.0%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration201.66 ± (201.72 - 202.71) ms201.11 ± (200.90 - 201.88) ms-0.3%
.NET Framework 4.8 - Bailout
duration207.76 ± (207.30 - 208.61) ms206.33 ± (205.94 - 206.96) ms-0.7%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1196.32 ± (1194.79 - 1202.16) ms1188.11 ± (1189.97 - 1197.51) ms-0.7%
.NET Core 3.1 - Baseline
process.internal_duration_ms196.24 ± (195.72 - 196.77) ms195.70 ± (195.23 - 196.17) ms-0.3%
process.time_to_main_ms85.24 ± (84.97 - 85.51) ms84.42 ± (84.15 - 84.68) ms-1.0%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed15.98 ± (15.97 - 16.00) MB15.99 ± (15.98 - 16.01) MB+0.1%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (19 - 20)-0.1%
.NET Core 3.1 - Bailout
process.internal_duration_ms195.33 ± (194.84 - 195.82) ms195.03 ± (194.55 - 195.51) ms-0.2%
process.time_to_main_ms85.92 ± (85.65 - 86.20) ms85.64 ± (85.41 - 85.87) ms-0.3%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.03 ± (16.01 - 16.05) MB16.06 ± (16.04 - 16.08) MB+0.2%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (21 - 21)+0.4%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms389.69 ± (388.31 - 391.07) ms391.12 ± (389.80 - 392.44) ms+0.4%✅⬆️
process.time_to_main_ms531.14 ± (529.61 - 532.67) ms532.35 ± (531.09 - 533.62) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed57.59 ± (57.36 - 57.83) MB57.96 ± (57.78 - 58.14) MB+0.6%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms200.19 ± (199.72 - 200.67) ms201.89 ± (201.36 - 202.42) ms+0.8%✅⬆️
process.time_to_main_ms73.50 ± (73.28 - 73.72) ms74.39 ± (74.17 - 74.60) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.30 ± (16.29 - 16.32) MB16.35 ± (16.34 - 16.37) MB+0.3%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.5%
.NET 6 - Bailout
process.internal_duration_ms200.04 ± (199.52 - 200.55) ms203.34 ± (202.70 - 203.99) ms+1.7%✅⬆️
process.time_to_main_ms74.99 ± (74.74 - 75.24) ms76.08 ± (75.77 - 76.38) ms+1.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.31 ± (16.29 - 16.33) MB16.31 ± (16.29 - 16.33) MB+0.0%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+1.0%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms593.30 ± (590.88 - 595.73) ms592.35 ± (589.62 - 595.08) ms-0.2%
process.time_to_main_ms530.23 ± (529.15 - 531.31) ms535.90 ± (534.73 - 537.07) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed60.77 ± (60.67 - 60.88) MB60.76 ± (60.66 - 60.87) MB-0.0%
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)-0.4%
.NET 8 - Baseline
process.internal_duration_ms199.81 ± (199.26 - 200.37) ms201.79 ± (201.19 - 202.40) ms+1.0%✅⬆️
process.time_to_main_ms73.28 ± (73.02 - 73.55) ms74.16 ± (73.88 - 74.44) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.66 ± (11.64 - 11.67) MB11.60 ± (11.58 - 11.61) MB-0.5%
runtime.dotnet.threads.count18 ± (18 - 18)19 ± (19 - 19)+1.6%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms199.28 ± (198.76 - 199.81) ms200.70 ± (200.03 - 201.38) ms+0.7%✅⬆️
process.time_to_main_ms74.55 ± (74.34 - 74.76) ms75.39 ± (75.12 - 75.66) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.69 ± (11.68 - 11.71) MB11.63 ± (11.61 - 11.65) MB-0.6%
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (20 - 20)+0.6%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms520.17 ± (515.94 - 524.40) ms521.10 ± (517.42 - 524.78) ms+0.2%✅⬆️
process.time_to_main_ms491.96 ± (490.85 - 493.08) ms497.89 ± (496.66 - 499.12) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.23 ± (50.19 - 50.27) MB50.16 ± (50.12 - 50.20) MB-0.1%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.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 (8487) - mean (73ms)  : 70, 76
    master - mean (75ms)  : 71, 79

    section Bailout
    This PR (8487) - mean (77ms)  : 75, 80
    master - mean (77ms)  : 74, 81

    section CallTarget+Inlining+NGEN
    This PR (8487) - mean (1,086ms)  : 1041, 1131
    master - mean (1,087ms)  : 1032, 1143

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 (8487) - mean (115ms)  : 111, 119
    master - mean (116ms)  : 110, 121

    section Bailout
    This PR (8487) - mean (119ms)  : 114, 125
    master - mean (115ms)  : 112, 118

    section CallTarget+Inlining+NGEN
    This PR (8487) - mean (783ms)  : 754, 813
    master - mean (780ms)  : 748, 813

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

    section Bailout
    This PR (8487) - mean (105ms)  : 99, 111
    master - mean (102ms)  : 99, 106

    section CallTarget+Inlining+NGEN
    This PR (8487) - mean (942ms)  : 903, 980
    master - mean (939ms)  : 900, 978

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

    section Bailout
    This PR (8487) - mean (105ms)  : 98, 112
    master - mean (102ms)  : 99, 104

    section CallTarget+Inlining+NGEN
    This PR (8487) - mean (825ms)  : 778, 873
    master - mean (829ms)  : 782, 875

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 (8487) - mean (201ms)  : 195, 208
    master - mean (202ms)  : 195, 209

    section Bailout
    This PR (8487) - mean (206ms)  : 199, 214
    master - mean (208ms)  : 198, 218

    section CallTarget+Inlining+NGEN
    This PR (8487) - mean (1,194ms)  : 1137, 1251
    master - mean (1,198ms)  : 1143, 1254

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 (8487) - mean (290ms)  : 280, 299
    master - mean (291ms)  : 280, 301

    section Bailout
    This PR (8487) - mean (290ms)  : 279, 301
    master - mean (291ms)  : 282, 299

    section CallTarget+Inlining+NGEN
    This PR (8487) - mean (956ms)  : 925, 988
    master - mean (957ms)  : 934, 980

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8487) - mean (286ms)  : 272, 300
    master - mean (283ms)  : 271, 295

    section Bailout
    This PR (8487) - mean (288ms)  : 274, 303
    master - mean (284ms)  : 274, 294

    section CallTarget+Inlining+NGEN
    This PR (8487) - mean (1,159ms)  : 1118, 1200
    master - mean (1,153ms)  : 1109, 1197

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8487) - mean (287ms)  : 273, 301
    master - mean (283ms)  : 271, 296

    section Bailout
    This PR (8487) - mean (289ms)  : 271, 307
    master - mean (285ms)  : 273, 297

    section CallTarget+Inlining+NGEN
    This PR (8487) - mean (1,052ms)  : 1000, 1105
    master - mean (1,044ms)  : 985, 1104

Loading

@andrewlock andrewlock force-pushed the andrew/encode-utf-8-at-buid-time branch from b895f2b to f3d2140 Compare April 24, 2026 18:55
@andrewlock andrewlock enabled auto-merge (squash) April 27, 2026 08:01
@andrewlock andrewlock merged commit a5f6d3d into master Apr 27, 2026
139 checks passed
@andrewlock andrewlock deleted the andrew/encode-utf-8-at-buid-time branch April 27, 2026 09:09
@github-actions github-actions Bot added this to the vNext-v3 milestone Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:performance Performance, speed, latency, resource usage (CPU, memory) type:refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants