-
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
Conversation
Datadog ReportBranch report: ✅ 0 Failed, 454290 Passed, 2763 Skipped, 19h 14m 31.22s Total Time |
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 (72ms) : 63, 80
. : milestone, 72,
master - mean (72ms) : 64, 80
. : milestone, 72,
section CallTarget+Inlining+NGEN
This PR (6266) - mean (1,101ms) : 1078, 1125
. : milestone, 1101,
master - mean (1,112ms) : 1091, 1134
. : milestone, 1112,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6266) - mean (108ms) : 104, 112
. : milestone, 108,
master - mean (109ms) : 106, 112
. : milestone, 109,
section CallTarget+Inlining+NGEN
This PR (6266) - mean (763ms) : 746, 780
. : milestone, 763,
master - mean (770ms) : 757, 782
. : milestone, 770,
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 (93ms) : 91, 95
. : milestone, 93,
section CallTarget+Inlining+NGEN
This PR (6266) - mean (720ms) : 700, 740
. : milestone, 720,
master - mean (724ms) : 709, 740
. : milestone, 724,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6266) - mean (191ms) : 185, 196
. : milestone, 191,
master - mean (190ms) : 185, 195
. : milestone, 190,
section CallTarget+Inlining+NGEN
This PR (6266) - mean (1,223ms) : 1195, 1251
. : milestone, 1223,
master - mean (1,229ms) : 1205, 1252
. : 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) : 273, 279
. : milestone, 276,
master - mean (277ms) : 273, 281
. : milestone, 277,
section CallTarget+Inlining+NGEN
This PR (6266) - mean (938ms) : 918, 957
. : milestone, 938,
master - mean (947ms) : 930, 963
. : milestone, 947,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6266) - mean (265ms) : 260, 269
. : milestone, 265,
master - mean (265ms) : 260, 269
. : milestone, 265,
section CallTarget+Inlining+NGEN
This PR (6266) - mean (925ms) : 906, 943
. : milestone, 925,
master - mean (928ms) : 907, 949
. : milestone, 928,
|
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) (11.217M) : 0, 11216581
master (11.092M) : 0, 11091647
benchmarks/2.9.0 (11.033M) : 0, 11032866
section Automatic
This PR (6266) (7.163M) : 0, 7163289
master (7.247M) : 0, 7247456
benchmarks/2.9.0 (7.786M) : 0, 7785853
section Trace stats
master (7.567M) : 0, 7566624
section Manual
master (11.125M) : 0, 11125038
section Manual + Automatic
This PR (6266) (6.661M) : 0, 6661402
master (6.734M) : 0, 6733580
section DD_TRACE_ENABLED=0
master (10.150M) : 0, 10149788
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6266) (9.583M) : 0, 9582832
master (9.672M) : 0, 9672005
benchmarks/2.9.0 (9.495M) : 0, 9494821
section Automatic
This PR (6266) (6.220M) : 0, 6220278
master (6.434M) : 0, 6433517
section Trace stats
master (6.711M) : 0, 6710571
section Manual
master (9.432M) : 0, 9431949
section Manual + Automatic
This PR (6266) (5.858M) : 0, 5858094
master (5.956M) : 0, 5955854
section DD_TRACE_ENABLED=0
master (8.885M) : 0, 8884829
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6266) (9.775M) : 0, 9775107
master (9.850M) : 0, 9849596
benchmarks/2.9.0 (10.020M) : 0, 10019592
section Automatic
This PR (6266) (6.793M) : 0, 6792606
master (6.340M) : 0, 6339934
benchmarks/2.9.0 (7.255M) : 0, 7255257
section Trace stats
master (6.803M) : 0, 6803435
section Manual
master (9.774M) : 0, 9774066
section Manual + Automatic
This PR (6266) (6.406M) : 0, 6405705
master (0.010M) : 0, 10074
section DD_TRACE_ENABLED=0
master (9.121M) : 0, 9121169
|
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 <andrew.lock@datadoghq.com>
7932f45
to
3286c90
Compare
Merge activity
|
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.