-
Notifications
You must be signed in to change notification settings - Fork 147
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
HTTP over streams: use vendored Utf8Parser.TryParse()
#6720
Conversation
Datadog ReportBranch report: ✅ 0 Failed, 252570 Passed, 2397 Skipped, 19h 42m 17.06s 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 (6720) - mean (70ms) : 64, 76
. : milestone, 70,
master - mean (70ms) : 66, 73
. : milestone, 70,
section CallTarget+Inlining+NGEN
This PR (6720) - mean (1,006ms) : 981, 1031
. : milestone, 1006,
master - mean (1,004ms) : 982, 1026
. : milestone, 1004,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6720) - mean (104ms) : 101, 106
. : milestone, 104,
master - mean (102ms) : 100, 105
. : milestone, 102,
section CallTarget+Inlining+NGEN
This PR (6720) - mean (691ms) : 674, 709
. : milestone, 691,
master - mean (688ms) : 670, 706
. : milestone, 688,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6720) - mean (90ms) : 88, 92
. : milestone, 90,
master - mean (89ms) : 87, 91
. : milestone, 89,
section CallTarget+Inlining+NGEN
This PR (6720) - mean (644ms) : 626, 662
. : milestone, 644,
master - mean (644ms) : 625, 662
. : milestone, 644,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6720) - mean (191ms) : 187, 196
. : milestone, 191,
master - mean (190ms) : 185, 195
. : milestone, 190,
section CallTarget+Inlining+NGEN
This PR (6720) - mean (1,112ms) : 1089, 1134
. : milestone, 1112,
master - mean (1,105ms) : 1081, 1130
. : milestone, 1105,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6720) - mean (270ms) : 267, 274
. : milestone, 270,
master - mean (269ms) : 266, 272
. : milestone, 269,
section CallTarget+Inlining+NGEN
This PR (6720) - mean (876ms) : 851, 901
. : milestone, 876,
master - mean (874ms) : 842, 905
. : milestone, 874,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6720) - mean (263ms) : 257, 268
. : milestone, 263,
master - mean (261ms) : 257, 265
. : milestone, 261,
section CallTarget+Inlining+NGEN
This PR (6720) - mean (857ms) : 824, 889
. : milestone, 857,
master - mean (856ms) : 827, 886
. : milestone, 856,
|
Utf8Parser.TryParse()
97ee6e6
to
08cda07
Compare
Benchmarks Report for tracer 🐌Benchmarks for #6720 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 ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Slower
|
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net6.0 | 1.139 | 1,232.60 | 1,404.04 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | CallElasticsearch |
net6.0 | 1.19μs | 0.604ns | 2.18ns | 0.0136 | 0 | 0 | 976 B |
master | CallElasticsearch |
netcoreapp3.1 | 1.55μs | 1.37ns | 5.29ns | 0.0132 | 0 | 0 | 976 B |
master | CallElasticsearch |
net472 | 2.46μs | 1.15ns | 4.32ns | 0.158 | 0 | 0 | 995 B |
master | CallElasticsearchAsync |
net6.0 | 1.23μs | 0.855ns | 3.31ns | 0.013 | 0 | 0 | 952 B |
master | CallElasticsearchAsync |
netcoreapp3.1 | 1.63μs | 0.777ns | 2.91ns | 0.0129 | 0 | 0 | 1.02 KB |
master | CallElasticsearchAsync |
net472 | 2.66μs | 0.442ns | 1.59ns | 0.166 | 0 | 0 | 1.05 KB |
#6720 | CallElasticsearch |
net6.0 | 1.22μs | 1.01ns | 3.93ns | 0.0136 | 0 | 0 | 976 B |
#6720 | CallElasticsearch |
netcoreapp3.1 | 1.62μs | 0.853ns | 3.31ns | 0.013 | 0 | 0 | 976 B |
#6720 | CallElasticsearch |
net472 | 2.54μs | 1.17ns | 4.37ns | 0.158 | 0 | 0 | 995 B |
#6720 | CallElasticsearchAsync |
net6.0 | 1.4μs | 1.24ns | 4.8ns | 0.0135 | 0 | 0 | 952 B |
#6720 | CallElasticsearchAsync |
netcoreapp3.1 | 1.63μs | 0.709ns | 2.56ns | 0.0133 | 0 | 0 | 1.02 KB |
#6720 | CallElasticsearchAsync |
net472 | 2.57μs | 1.24ns | 4.63ns | 0.166 | 0 | 0 | 1.05 KB |
Benchmarks.Trace.GraphQLBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #6720
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑netcoreapp3.1
1.136
1,538.99
1,748.66
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑netcoreapp3.1 | 1.136 | 1,538.99 | 1,748.66 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | ExecuteAsync |
net6.0 | 1.31μs | 0.379ns | 1.37ns | 0.0134 | 0 | 0 | 952 B |
master | ExecuteAsync |
netcoreapp3.1 | 1.54μs | 0.406ns | 1.57ns | 0.0123 | 0 | 0 | 952 B |
master | ExecuteAsync |
net472 | 1.82μs | 0.663ns | 2.48ns | 0.145 | 0 | 0 | 915 B |
#6720 | ExecuteAsync |
net6.0 | 1.43μs | 0.355ns | 1.33ns | 0.0133 | 0 | 0 | 952 B |
#6720 | ExecuteAsync |
netcoreapp3.1 | 1.75μs | 1.41ns | 5.09ns | 0.0125 | 0 | 0 | 952 B |
#6720 | ExecuteAsync |
net472 | 1.88μs | 0.678ns | 2.44ns | 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.52μs | 2.28ns | 8.83ns | 0.0317 | 0 | 0 | 2.31 KB |
master | SendAsync |
netcoreapp3.1 | 5.33μs | 2.32ns | 8.69ns | 0.0374 | 0 | 0 | 2.85 KB |
master | SendAsync |
net472 | 7.58μs | 2.23ns | 8.63ns | 0.495 | 0 | 0 | 3.12 KB |
#6720 | SendAsync |
net6.0 | 4.39μs | 1.48ns | 5.55ns | 0.0329 | 0 | 0 | 2.31 KB |
#6720 | SendAsync |
netcoreapp3.1 | 5.27μs | 1.41ns | 5.1ns | 0.0395 | 0 | 0 | 2.85 KB |
#6720 | SendAsync |
net472 | 7.56μs | 2.08ns | 8.07ns | 0.495 | 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.46μs | 0.721ns | 2.7ns | 0.0226 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.21μs | 1.5ns | 5.61ns | 0.0221 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
net472 | 2.57μs | 0.925ns | 3.58ns | 0.249 | 0 | 0 | 1.57 KB |
#6720 | EnrichedLog |
net6.0 | 1.43μs | 0.85ns | 3.29ns | 0.0229 | 0 | 0 | 1.64 KB |
#6720 | EnrichedLog |
netcoreapp3.1 | 2.26μs | 1.47ns | 5.29ns | 0.0224 | 0 | 0 | 1.64 KB |
#6720 | EnrichedLog |
net472 | 2.49μs | 0.747ns | 2.89ns | 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 | 113μs | 125ns | 485ns | 0.0565 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
netcoreapp3.1 | 117μs | 269ns | 1.04μs | 0.058 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
net472 | 149μs | 119ns | 459ns | 0.67 | 0.223 | 0 | 4.46 KB |
#6720 | EnrichedLog |
net6.0 | 111μs | 116ns | 449ns | 0.0553 | 0 | 0 | 4.28 KB |
#6720 | EnrichedLog |
netcoreapp3.1 | 117μs | 233ns | 903ns | 0.0586 | 0 | 0 | 4.28 KB |
#6720 | EnrichedLog |
net472 | 147μs | 124ns | 466ns | 0.661 | 0.22 | 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.07μs | 0.605ns | 2.18ns | 0.0305 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.24μs | 1.06ns | 3.95ns | 0.0299 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
net472 | 4.82μs | 1.12ns | 4.34ns | 0.319 | 0 | 0 | 2.02 KB |
#6720 | EnrichedLog |
net6.0 | 3.04μs | 1.21ns | 4.51ns | 0.0305 | 0 | 0 | 2.2 KB |
#6720 | EnrichedLog |
netcoreapp3.1 | 4.09μs | 0.989ns | 3.83ns | 0.0285 | 0 | 0 | 2.2 KB |
#6720 | EnrichedLog |
net472 | 4.86μs | 2.02ns | 7.81ns | 0.319 | 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.32μs | 1.3ns | 5.03ns | 0.0161 | 0 | 0 | 1.14 KB |
master | SendReceive |
netcoreapp3.1 | 1.77μs | 1.98ns | 7.66ns | 0.015 | 0 | 0 | 1.14 KB |
master | SendReceive |
net472 | 2.08μs | 1.79ns | 6.93ns | 0.184 | 0 | 0 | 1.16 KB |
#6720 | SendReceive |
net6.0 | 1.37μs | 0.959ns | 3.71ns | 0.0163 | 0 | 0 | 1.14 KB |
#6720 | SendReceive |
netcoreapp3.1 | 1.76μs | 0.827ns | 3.2ns | 0.015 | 0 | 0 | 1.14 KB |
#6720 | SendReceive |
net472 | 2.14μs | 0.625ns | 2.34ns | 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.72μs | 0.995ns | 3.86ns | 0.0218 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.91μs | 1.19ns | 4.46ns | 0.0214 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 4.23μs | 2.68ns | 10ns | 0.323 | 0 | 0 | 2.04 KB |
#6720 | EnrichedLog |
net6.0 | 2.83μs | 1ns | 3.75ns | 0.0226 | 0 | 0 | 1.6 KB |
#6720 | EnrichedLog |
netcoreapp3.1 | 3.9μs | 1.49ns | 5.76ns | 0.0214 | 0 | 0 | 1.65 KB |
#6720 | EnrichedLog |
net472 | 4.25μs | 1.99ns | 7.45ns | 0.322 | 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 | 409ns | 0.0715ns | 0.267ns | 0.00811 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 602ns | 0.432ns | 1.67ns | 0.00785 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 659ns | 0.167ns | 0.626ns | 0.0918 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 522ns | 0.215ns | 0.803ns | 0.00979 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 701ns | 0.744ns | 2.78ns | 0.00936 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 822ns | 0.815ns | 3.16ns | 0.104 | 0 | 0 | 658 B |
#6720 | StartFinishSpan |
net6.0 | 412ns | 0.153ns | 0.591ns | 0.00801 | 0 | 0 | 576 B |
#6720 | StartFinishSpan |
netcoreapp3.1 | 617ns | 0.259ns | 1ns | 0.00773 | 0 | 0 | 576 B |
#6720 | StartFinishSpan |
net472 | 598ns | 0.302ns | 1.17ns | 0.0918 | 0 | 0 | 578 B |
#6720 | StartFinishScope |
net6.0 | 498ns | 0.115ns | 0.444ns | 0.0099 | 0 | 0 | 696 B |
#6720 | StartFinishScope |
netcoreapp3.1 | 735ns | 1.48ns | 5.72ns | 0.00901 | 0 | 0 | 696 B |
#6720 | StartFinishScope |
net472 | 822ns | 0.583ns | 2.18ns | 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 | 606ns | 0.195ns | 0.756ns | 0.00974 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 961ns | 0.384ns | 1.49ns | 0.00932 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.06μs | 0.562ns | 2.1ns | 0.104 | 0 | 0 | 658 B |
#6720 | RunOnMethodBegin |
net6.0 | 669ns | 0.362ns | 1.4ns | 0.00999 | 0 | 0 | 696 B |
#6720 | RunOnMethodBegin |
netcoreapp3.1 | 979ns | 0.475ns | 1.84ns | 0.00929 | 0 | 0 | 696 B |
#6720 | RunOnMethodBegin |
net472 | 1.02μs | 0.306ns | 1.15ns | 0.104 | 0 | 0 | 658 B |
08cda07
to
f6984b4
Compare
f6984b4
to
e905c25
Compare
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.
👍
Utf8Parser.TryParse()
Utf8Parser.TryParse()
Summary of changes
We have a "vendored" copy of
Utf8Parser
available to use now, so use that instead of copying the code forUtf8Parser.TryParse()
to use in older runtimes.Reason for change
Reduce code duplication. Maintainability, etc, etc. First step towards a larger clean up of "vendored" runtime code.
Implementation details
Utf8Parser
fromSystem.Buffers.Text
(we were already doing this for .NET >= 6)Utf8Parser
fromDatadog.Trace.VendoredMicrosoftCode.System.Buffers.Text
Utf8Parser.TryParse()
that is no longer usedTest coverage
No change in behavior. Existing tests should pass.
Other details
n/a