-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
baggage propagator clean up #6266
base: master
Are you sure you want to change the base?
Conversation
Datadog ReportBranch report: ❌ 1 Failed (1 Known Flaky), 367888 Passed, 2082 Skipped, 14h 10m 26.9s Total Time ❌ Failed Tests (1)
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing the following branches/commits: 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 shown in red. The following thresholds were used for comparing the execution times:
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). gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6266) - mean (70ms) : 67, 72
. : milestone, 70,
master - mean (70ms) : 68, 72
. : milestone, 70,
section CallTarget+Inlining+NGEN
This PR (6266) - mean (1,114ms) : 1094, 1134
. : milestone, 1114,
master - mean (1,114ms) : 1097, 1130
. : milestone, 1114,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6266) - mean (108ms) : 106, 110
. : milestone, 108,
master - mean (108ms) : 105, 110
. : milestone, 108,
section CallTarget+Inlining+NGEN
This PR (6266) - mean (771ms) : 758, 783
. : milestone, 771,
master - mean (775ms) : 762, 788
. : milestone, 775,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6266) - mean (92ms) : 90, 94
. : milestone, 92,
master - mean (92ms) : 90, 94
. : milestone, 92,
section CallTarget+Inlining+NGEN
This PR (6266) - mean (731ms) : 717, 744
. : milestone, 731,
master - mean (732ms) : 712, 751
. : milestone, 732,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6266) - mean (190ms) : 187, 193
. : milestone, 190,
master - mean (190ms) : 186, 193
. : milestone, 190,
section CallTarget+Inlining+NGEN
This PR (6266) - mean (1,229ms) : 1206, 1253
. : milestone, 1229,
master - mean (1,229ms) : 1202, 1256
. : milestone, 1229,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6266) - mean (276ms) : 270, 281
. : milestone, 276,
master - mean (277ms) : 272, 282
. : milestone, 277,
section CallTarget+Inlining+NGEN
This PR (6266) - mean (948ms) : 932, 964
. : milestone, 948,
master - mean (954ms) : 937, 970
. : milestone, 954,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6266) - mean (266ms) : 262, 270
. : milestone, 266,
master - mean (263ms) : 259, 268
. : milestone, 263,
section CallTarget+Inlining+NGEN
This PR (6266) - mean (939ms) : 918, 959
. : milestone, 939,
master - mean (934ms) : 914, 954
. : milestone, 934,
|
Benchmarks Report for tracer 🐌Benchmarks for #6266 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Fewer allocations 🎉
|
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 | 41.82 KB | 41.46 KB | -362 B | -0.87% |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | WriteAndFlushEnrichedTraces |
net6.0 | 602μs | 3.43μs | 30.9μs | 0.558 | 0 | 0 | 41.82 KB |
master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 676μs | 3.26μs | 12.6μs | 0.349 | 0 | 0 | 41.78 KB |
master | WriteAndFlushEnrichedTraces |
net472 | 867μs | 3.74μs | 14.5μs | 8.25 | 2.6 | 0.434 | 53.27 KB |
#6266 | WriteAndFlushEnrichedTraces |
net6.0 | 554μs | 2.45μs | 9.17μs | 0.553 | 0 | 0 | 41.46 KB |
#6266 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 670μs | 2.04μs | 7.9μs | 0.338 | 0 | 0 | 41.83 KB |
#6266 | WriteAndFlushEnrichedTraces |
net472 | 888μs | 2.44μs | 9.11μs | 8.5 | 2.55 | 0.425 | 53.32 KB |
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | ExecuteNonQuery |
net6.0 | 1.23μs | 1.52ns | 5.87ns | 0.0145 | 0 | 0 | 1.02 KB |
master | ExecuteNonQuery |
netcoreapp3.1 | 1.77μs | 0.875ns | 3.27ns | 0.0133 | 0 | 0 | 1.02 KB |
master | ExecuteNonQuery |
net472 | 2.11μs | 1.33ns | 4.97ns | 0.156 | 0.00106 | 0 | 987 B |
#6266 | ExecuteNonQuery |
net6.0 | 1.3μs | 1.04ns | 4.04ns | 0.0141 | 0 | 0 | 1.02 KB |
#6266 | ExecuteNonQuery |
netcoreapp3.1 | 1.78μs | 1.55ns | 5.99ns | 0.0141 | 0 | 0 | 1.02 KB |
#6266 | ExecuteNonQuery |
net472 | 2.09μs | 1.76ns | 6.34ns | 0.157 | 0.00104 | 0 | 987 B |
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | CallElasticsearch |
net6.0 | 1.23μs | 0.403ns | 1.51ns | 0.0136 | 0 | 0 | 976 B |
master | CallElasticsearch |
netcoreapp3.1 | 1.55μs | 0.864ns | 3.35ns | 0.0131 | 0 | 0 | 976 B |
master | CallElasticsearch |
net472 | 2.48μs | 2.6ns | 10.1ns | 0.157 | 0 | 0 | 995 B |
master | CallElasticsearchAsync |
net6.0 | 1.24μs | 0.543ns | 2.1ns | 0.013 | 0 | 0 | 952 B |
master | CallElasticsearchAsync |
netcoreapp3.1 | 1.6μs | 0.683ns | 2.55ns | 0.0137 | 0 | 0 | 1.02 KB |
master | CallElasticsearchAsync |
net472 | 2.61μs | 2.81ns | 10.9ns | 0.167 | 0 | 0 | 1.05 KB |
#6266 | CallElasticsearch |
net6.0 | 1.16μs | 0.916ns | 3.3ns | 0.0134 | 0 | 0 | 976 B |
#6266 | CallElasticsearch |
netcoreapp3.1 | 1.52μs | 0.423ns | 1.53ns | 0.0128 | 0 | 0 | 976 B |
#6266 | CallElasticsearch |
net472 | 2.5μs | 0.997ns | 3.86ns | 0.158 | 0 | 0 | 995 B |
#6266 | CallElasticsearchAsync |
net6.0 | 1.32μs | 0.707ns | 2.74ns | 0.0132 | 0 | 0 | 952 B |
#6266 | CallElasticsearchAsync |
netcoreapp3.1 | 1.61μs | 0.724ns | 2.8ns | 0.0145 | 0 | 0 | 1.02 KB |
#6266 | CallElasticsearchAsync |
net472 | 2.52μs | 0.978ns | 3.79ns | 0.167 | 0 | 0 | 1.05 KB |
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | ExecuteAsync |
net6.0 | 1.29μs | 0.685ns | 2.56ns | 0.0135 | 0 | 0 | 952 B |
master | ExecuteAsync |
netcoreapp3.1 | 1.67μs | 1.73ns | 6.47ns | 0.0125 | 0 | 0 | 952 B |
master | ExecuteAsync |
net472 | 1.84μs | 0.699ns | 2.61ns | 0.145 | 0 | 0 | 915 B |
#6266 | ExecuteAsync |
net6.0 | 1.29μs | 0.575ns | 2.15ns | 0.013 | 0 | 0 | 952 B |
#6266 | ExecuteAsync |
netcoreapp3.1 | 1.68μs | 1.04ns | 4.02ns | 0.0125 | 0 | 0 | 952 B |
#6266 | ExecuteAsync |
net472 | 1.7μs | 0.323ns | 1.21ns | 0.145 | 0 | 0 | 915 B |
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | SendAsync |
net6.0 | 4.46μs | 1.22ns | 4.57ns | 0.0313 | 0 | 0 | 2.31 KB |
master | SendAsync |
netcoreapp3.1 | 5.2μs | 1.63ns | 6.3ns | 0.039 | 0 | 0 | 2.85 KB |
master | SendAsync |
net472 | 7.52μs | 2.64ns | 10.2ns | 0.495 | 0 | 0 | 3.12 KB |
#6266 | SendAsync |
net6.0 | 4.45μs | 3.51ns | 13.1ns | 0.0309 | 0 | 0 | 2.31 KB |
#6266 | SendAsync |
netcoreapp3.1 | 5.1μs | 2.27ns | 8.2ns | 0.0383 | 0 | 0 | 2.85 KB |
#6266 | SendAsync |
net472 | 7.35μs | 1.5ns | 5.4ns | 0.493 | 0 | 0 | 3.12 KB |
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | EnrichedLog |
net6.0 | 1.48μs | 1ns | 3.76ns | 0.0231 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.32μs | 1.88ns | 7.05ns | 0.022 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
net472 | 2.64μs | 2ns | 7.74ns | 0.249 | 0 | 0 | 1.57 KB |
#6266 | EnrichedLog |
net6.0 | 1.49μs | 1.5ns | 5.62ns | 0.0227 | 0 | 0 | 1.64 KB |
#6266 | EnrichedLog |
netcoreapp3.1 | 2.11μs | 1.9ns | 7.34ns | 0.022 | 0 | 0 | 1.64 KB |
#6266 | EnrichedLog |
net472 | 2.63μs | 0.82ns | 2.96ns | 0.249 | 0 | 0 | 1.57 KB |
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | EnrichedLog |
net6.0 | 119μs | 95.3ns | 369ns | 0.0594 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
netcoreapp3.1 | 122μs | 175ns | 632ns | 0 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
net472 | 154μs | 177ns | 685ns | 0.688 | 0.229 | 0 | 4.46 KB |
#6266 | EnrichedLog |
net6.0 | 120μs | 295ns | 1.14μs | 0.0601 | 0 | 0 | 4.28 KB |
#6266 | EnrichedLog |
netcoreapp3.1 | 121μs | 219ns | 850ns | 0 | 0 | 0 | 4.28 KB |
#6266 | EnrichedLog |
net472 | 154μs | 220ns | 853ns | 0.688 | 0.229 | 0 | 4.46 KB |
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | EnrichedLog |
net6.0 | 3.04μs | 13.8ns | 55.2ns | 0.0302 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.23μs | 3.92ns | 15.2ns | 0.0295 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
net472 | 4.91μs | 1.62ns | 6.27ns | 0.32 | 0 | 0 | 2.02 KB |
#6266 | EnrichedLog |
net6.0 | 2.88μs | 0.827ns | 3.09ns | 0.0301 | 0 | 0 | 2.2 KB |
#6266 | EnrichedLog |
netcoreapp3.1 | 4.14μs | 3.48ns | 13.5ns | 0.0289 | 0 | 0 | 2.2 KB |
#6266 | EnrichedLog |
net472 | 4.9μs | 0.943ns | 3.53ns | 0.32 | 0 | 0 | 2.02 KB |
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | SendReceive |
net6.0 | 1.45μs | 0.771ns | 2.99ns | 0.0159 | 0 | 0 | 1.14 KB |
master | SendReceive |
netcoreapp3.1 | 1.78μs | 0.775ns | 3ns | 0.0151 | 0 | 0 | 1.14 KB |
master | SendReceive |
net472 | 2.17μs | 4.16ns | 16.1ns | 0.183 | 0 | 0 | 1.16 KB |
#6266 | SendReceive |
net6.0 | 1.36μs | 1.05ns | 4.06ns | 0.0163 | 0 | 0 | 1.14 KB |
#6266 | SendReceive |
netcoreapp3.1 | 1.81μs | 1.62ns | 6.29ns | 0.0153 | 0 | 0 | 1.14 KB |
#6266 | SendReceive |
net472 | 2.18μs | 2.62ns | 10.2ns | 0.183 | 0 | 0 | 1.16 KB |
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | EnrichedLog |
net6.0 | 2.8μs | 1.58ns | 5.9ns | 0.0224 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.9μs | 2.96ns | 11.5ns | 0.0214 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 4.39μs | 2.57ns | 9.96ns | 0.323 | 0 | 0 | 2.04 KB |
#6266 | EnrichedLog |
net6.0 | 2.73μs | 0.846ns | 3.28ns | 0.0221 | 0 | 0 | 1.6 KB |
#6266 | EnrichedLog |
netcoreapp3.1 | 3.76μs | 1.81ns | 7.01ns | 0.0207 | 0 | 0 | 1.65 KB |
#6266 | EnrichedLog |
net472 | 4.39μs | 1.31ns | 4.89ns | 0.323 | 0 | 0 | 2.04 KB |
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 406ns | 0.284ns | 1.1ns | 0.00803 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 640ns | 0.846ns | 3.28ns | 0.00779 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 733ns | 0.76ns | 2.63ns | 0.0916 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 492ns | 0.575ns | 2.07ns | 0.00976 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 736ns | 0.596ns | 2.31ns | 0.00911 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 873ns | 1.52ns | 5.48ns | 0.104 | 0 | 0 | 658 B |
#6266 | StartFinishSpan |
net6.0 | 400ns | 0.141ns | 0.509ns | 0.00801 | 0 | 0 | 576 B |
#6266 | StartFinishSpan |
netcoreapp3.1 | 585ns | 0.628ns | 2.43ns | 0.00755 | 0 | 0 | 576 B |
#6266 | StartFinishSpan |
net472 | 712ns | 0.204ns | 0.79ns | 0.0916 | 0 | 0 | 578 B |
#6266 | StartFinishScope |
net6.0 | 488ns | 0.231ns | 0.894ns | 0.00985 | 0 | 0 | 696 B |
#6266 | StartFinishScope |
netcoreapp3.1 | 753ns | 1.42ns | 5.33ns | 0.00939 | 0 | 0 | 696 B |
#6266 | StartFinishScope |
net472 | 907ns | 0.355ns | 1.38ns | 0.104 | 0 | 0 | 658 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | RunOnMethodBegin |
net6.0 | 600ns | 0.444ns | 1.72ns | 0.00965 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 954ns | 1.8ns | 6.98ns | 0.00911 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.12μs | 0.714ns | 2.76ns | 0.104 | 0 | 0 | 658 B |
#6266 | RunOnMethodBegin |
net6.0 | 596ns | 0.312ns | 1.21ns | 0.00987 | 0 | 0 | 696 B |
#6266 | RunOnMethodBegin |
netcoreapp3.1 | 932ns | 0.283ns | 1.06ns | 0.00943 | 0 | 0 | 696 B |
#6266 | RunOnMethodBegin |
net472 | 1.16μs | 0.429ns | 1.66ns | 0.104 | 0 | 0 | 658 B |
Throughput/Crank Report ⚡Throughput results for AspNetCoreSimpleController comparing the following branches/commits: Cases where throughput results for the PR are worse than latest master (5% drop or greater), results are shown in red. Note that these results are based on a single point-in-time result for each branch. For full results, see one of the many, many dashboards! gantt
title Throughput Linux x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6266) (10.976M) : 0, 10976437
master (11.114M) : 0, 11114066
benchmarks/2.9.0 (11.033M) : 0, 11032866
section Automatic
This PR (6266) (7.092M) : 0, 7091776
master (7.233M) : 0, 7232575
benchmarks/2.9.0 (7.786M) : 0, 7785853
section Trace stats
master (7.493M) : 0, 7493020
section Manual
master (10.881M) : 0, 10881078
section Manual + Automatic
This PR (6266) (6.491M) : 0, 6491000
master (6.542M) : 0, 6542224
section DD_TRACE_ENABLED=0
master (10.339M) : 0, 10339304
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6266) (9.505M) : 0, 9505238
master (9.350M) : 0, 9349696
benchmarks/2.9.0 (9.495M) : 0, 9494821
section Automatic
This PR (6266) (6.364M) : 0, 6363801
master (6.299M) : 0, 6299169
section Trace stats
master (6.519M) : 0, 6519254
section Manual
master (9.686M) : 0, 9685912
section Manual + Automatic
This PR (6266) (5.964M) : 0, 5964289
master (6.024M) : 0, 6023599
section DD_TRACE_ENABLED=0
master (8.947M) : 0, 8946801
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6266) (9.873M) : 0, 9872584
master (9.845M) : 0, 9844694
benchmarks/2.9.0 (10.020M) : 0, 10019592
section Automatic
This PR (6266) (6.402M) : 0, 6402153
master (6.255M) : 0, 6255151
benchmarks/2.9.0 (7.255M) : 0, 7255257
section Trace stats
master (6.988M) : 0, 6988095
section Manual
master (10.029M) : 0, 10029454
section Manual + Automatic
This PR (6266) (5.904M) : 0, 5903947
master (5.901M) : 0, 5901061
section DD_TRACE_ENABLED=0
master (9.102M) : 0, 9101760
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice results! Didn't entirely follow the changes tbh, but this is a case of "if you have tests for it all, I'm happy" 😄
tracer/test/Datadog.Trace.Tests/Propagators/W3CBaggagePropagatorTests.cs
Show resolved
Hide resolved
466606c
to
6a5004f
Compare
Co-authored-by: Andrew Lock <[email protected]>
7932f45
to
3286c90
Compare
Summary of changes
Refactored how we generated the
baggage
header value inW3CBaggagePropagator
to be faster and minimize heap allocations.Reason for change
Performance
Implementation details
1.
string
andStringBuilder
managementWe now use a single
StringBuilder
(fromStringBuilderCache
) to build the entirebaggage
header. Previously the code was trying to acquire a builder to encode keys and values while already holding another builder for the header itself. With this change, we no longer allocate multipleStringBuilder
instances that don't get reused, and we no longer allocation individual strings for:2. checking earlier if string needs encoding
Before this PR, we always converted every key and value into UTF-8 bytes before checking if any bytes needed percent-encoding (aka url-encoding). When encoding was not needed (the common case), we could avoid the conversion and use the original string directly.
Now we check if the string's characters need encoding before converting them to bytes. When encoding is not needed (the common case), we skip the conversion from string to UTF-8 bytes.
Benchmarks
With allowed characters only (no percent-encoding required)
With characters that require percent-encoding (whitespace and Unicode)
Test coverage
All
W3CBaggagePropagatorTests
are passing.Other details
Follow-up from #6158.