-
Notifications
You must be signed in to change notification settings - Fork 150
Create a more optimized AspNetCoreResourceNameHelper
#7966
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
base: andrew/single-span/3-observer
Are you sure you want to change the base?
Create a more optimized AspNetCoreResourceNameHelper
#7966
Conversation
|
c2c2b8c to
37760e4
Compare
5e4ff26 to
bdd3a0f
Compare
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7966) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-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:
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 chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7966) - mean (69ms) : 67, 70
master - mean (69ms) : 67, 70
section Bailout
This PR (7966) - mean (72ms) : 71, 73
master - mean (72ms) : 71, 73
section CallTarget+Inlining+NGEN
This PR (7966) - mean (1,016ms) : 947, 1085
master - mean (1,010ms) : 953, 1066
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 (7966) - mean (106ms) : 104, 108
master - mean (106ms) : 104, 108
section Bailout
This PR (7966) - mean (106ms) : 105, 108
master - mean (107ms) : 106, 108
section CallTarget+Inlining+NGEN
This PR (7966) - mean (741ms) : 667, 814
master - mean (715ms) : 670, 760
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7966) - mean (93ms) : 91, 96
master - mean (93ms) : 91, 95
section Bailout
This PR (7966) - mean (94ms) : 93, 95
master - mean (94ms) : 93, 95
section CallTarget+Inlining+NGEN
This PR (7966) - mean (713ms) : crit, 665, 761
master - mean (667ms) : 646, 689
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7966) - mean (93ms) : 90, 95
master - mean (92ms) : 90, 94
section Bailout
This PR (7966) - mean (93ms) : 92, 94
master - mean (93ms) : 91, 94
section CallTarget+Inlining+NGEN
This PR (7966) - mean (637ms) : 621, 652
master - mean (629ms) : 616, 642
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 (7966) - mean (194ms) : 189, 199
master - mean (194ms) : 190, 197
section Bailout
This PR (7966) - mean (197ms) : 195, 199
master - mean (197ms) : 194, 200
section CallTarget+Inlining+NGEN
This PR (7966) - mean (1,121ms) : 1058, 1184
master - mean (1,114ms) : 1069, 1160
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 (7966) - mean (277ms) : 272, 282
master - mean (277ms) : 272, 281
section Bailout
This PR (7966) - mean (279ms) : 275, 284
master - mean (277ms) : 273, 281
section CallTarget+Inlining+NGEN
This PR (7966) - mean (932ms) : 881, 982
master - mean (916ms) : 868, 963
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7966) - mean (272ms) : 268, 276
master - mean (270ms) : 265, 275
section Bailout
This PR (7966) - mean (271ms) : 269, 274
master - mean (270ms) : 267, 273
section CallTarget+Inlining+NGEN
This PR (7966) - mean (940ms) : 903, 976
master - mean (895ms) : 849, 940
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7966) - mean (270ms) : 264, 277
master - mean (269ms) : 263, 275
section Bailout
This PR (7966) - mean (271ms) : 267, 274
master - mean (270ms) : 265, 275
section CallTarget+Inlining+NGEN
This PR (7966) - mean (830ms) : 813, 846
master - mean (825ms) : 797, 852
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
37760e4 to
65dcd0e
Compare
bdd3a0f to
88205c8
Compare
| } | ||
| else | ||
| { | ||
| sb.Append(parameterName); |
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.
NIT: Previously we were not appending the parameterName to the route name but write an empty value if no value was found. This change seems reasonable, but still worth to note the different which, I assume, is intended.
NachoEchevarria
left a comment
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.
LGTM!
Summary of changes
Creates an optimized version of
AspNetCoreResourceNameHelperfor use by the single-span Diagnostic observer.Reason for change
We have the opportunity for a variety of optimizations thanks to not creating the MVC span, and the fact that we're .NET 6+. We could potentially include some or all of these optimizations in the existing observer path, but for safety/simplicity I'd rather keep it isolated for now, and we can look at expanding it more broadly later
Implementation details
ValueStringBuilderto build a resource nameToLowerInvariant, instead of doing an extra ToLower() at the endTest coverage
Added unit tests that use the existing data for the other implementations, to confirm it's identical. It's also covered indirectly by the integration tests
Other details
https://datadoghq.atlassian.net/browse/LANGPLAT-842
Part of a stack
ValueStringBuilderfor .NET 6 #7962AspNetCoreDiagnosticObserver#7963AspNetCoreResourceNameHelper#7966 👈