Use SpanCharSplitter for parsing source link URLs#8349
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d8afdda3d
ℹ️ 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".
BenchmarksBenchmark execution time: 2026-03-25 12:35:32 Comparing candidate commit c5501e0 in PR branch Found 9 performance improvements and 6 performance regressions! Performance is the same for 259 metrics, 14 unstable metrics.
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8349) and master.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Metric | Master (Mean ± 95% CI) | Current (Mean ± 95% CI) | Change | Status |
|---|---|---|---|---|
| .NET Framework 4.8 - Baseline | ||||
| duration | 192.79 ± (192.85 - 193.66) ms | 207.02 ± (207.19 - 208.19) ms | +7.4% | ❌⬆️ |
| .NET Framework 4.8 - Bailout | ||||
| duration | 196.20 ± (195.92 - 196.62) ms | 212.29 ± (212.31 - 213.48) ms | +8.2% | ❌⬆️ |
Full Metrics Comparison
FakeDbCommand
| Metric | Master (Mean ± 95% CI) | Current (Mean ± 95% CI) | Change | Status |
|---|---|---|---|---|
| .NET Framework 4.8 - Baseline | ||||
| duration | 68.64 ± (68.83 - 69.29) ms | 72.11 ± (72.07 - 72.44) ms | +5.0% | ✅⬆️ |
| .NET Framework 4.8 - Bailout | ||||
| duration | 79.83 ± (78.88 - 80.41) ms | 76.28 ± (76.09 - 76.45) ms | -4.5% | ✅ |
| .NET Framework 4.8 - CallTarget+Inlining+NGEN | ||||
| duration | 1047.72 ± (1050.50 - 1058.26) ms | 1075.13 ± (1075.47 - 1081.61) ms | +2.6% | ✅⬆️ |
| .NET Core 3.1 - Baseline | ||||
| process.internal_duration_ms | 21.78 ± (21.75 - 21.81) ms | 22.43 ± (22.39 - 22.46) ms | +3.0% | ✅⬆️ |
| process.time_to_main_ms | 79.31 ± (79.15 - 79.47) ms | 84.02 ± (83.83 - 84.22) ms | +5.9% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 10.90 ± (10.90 - 10.91) MB | 10.92 ± (10.92 - 10.92) MB | +0.2% | ✅⬆️ |
| runtime.dotnet.threads.count | 12 ± (12 - 12) | 12 ± (12 - 12) | +0.0% | ✅ |
| .NET Core 3.1 - Bailout | ||||
| process.internal_duration_ms | 21.73 ± (21.71 - 21.75) ms | 22.41 ± (22.37 - 22.44) ms | +3.1% | ✅⬆️ |
| process.time_to_main_ms | 80.66 ± (80.54 - 80.78) ms | 85.41 ± (85.23 - 85.58) ms | +5.9% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 10.94 ± (10.93 - 10.94) MB | 10.95 ± (10.95 - 10.96) MB | +0.1% | ✅⬆️ |
| runtime.dotnet.threads.count | 13 ± (13 - 13) | 13 ± (13 - 13) | +0.0% | ✅ |
| .NET Core 3.1 - CallTarget+Inlining+NGEN | ||||
| process.internal_duration_ms | 216.87 ± (215.60 - 218.14) ms | 225.42 ± (224.14 - 226.70) ms | +3.9% | ✅⬆️ |
| process.time_to_main_ms | 520.24 ± (519.26 - 521.21) ms | 535.23 ± (533.93 - 536.54) ms | +2.9% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 48.24 ± (48.21 - 48.26) MB | 48.23 ± (48.20 - 48.26) MB | -0.0% | ✅ |
| runtime.dotnet.threads.count | 28 ± (28 - 28) | 28 ± (28 - 28) | -1.2% | ✅ |
| .NET 6 - Baseline | ||||
| process.internal_duration_ms | 20.58 ± (20.55 - 20.60) ms | 21.03 ± (21.00 - 21.07) ms | +2.2% | ✅⬆️ |
| process.time_to_main_ms | 68.89 ± (68.75 - 69.03) ms | 72.61 ± (72.43 - 72.80) ms | +5.4% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 10.59 ± (10.59 - 10.59) MB | 10.63 ± (10.63 - 10.63) MB | +0.4% | ✅⬆️ |
| runtime.dotnet.threads.count | 10 ± (10 - 10) | 10 ± (10 - 10) | +0.0% | ✅ |
| .NET 6 - Bailout | ||||
| process.internal_duration_ms | 20.59 ± (20.56 - 20.62) ms | 20.94 ± (20.90 - 20.97) ms | +1.7% | ✅⬆️ |
| process.time_to_main_ms | 69.81 ± (69.67 - 69.94) ms | 73.52 ± (73.33 - 73.71) ms | +5.3% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 10.66 ± (10.65 - 10.66) MB | 10.74 ± (10.73 - 10.74) MB | +0.7% | ✅⬆️ |
| runtime.dotnet.threads.count | 11 ± (11 - 11) | 11 ± (11 - 11) | +0.0% | ✅ |
| .NET 6 - CallTarget+Inlining+NGEN | ||||
| process.internal_duration_ms | 208.33 ± (207.01 - 209.64) ms | 213.92 ± (212.42 - 215.42) ms | +2.7% | ✅⬆️ |
| process.time_to_main_ms | 518.76 ± (517.69 - 519.83) ms | 536.95 ± (535.59 - 538.31) ms | +3.5% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 50.00 ± (49.95 - 50.05) MB | 50.15 ± (50.11 - 50.18) MB | +0.3% | ✅⬆️ |
| runtime.dotnet.threads.count | 29 ± (29 - 29) | 29 ± (29 - 29) | +0.2% | ✅⬆️ |
| .NET 8 - Baseline | ||||
| process.internal_duration_ms | 18.74 ± (18.71 - 18.77) ms | 19.17 ± (19.13 - 19.22) ms | +2.3% | ✅⬆️ |
| process.time_to_main_ms | 67.94 ± (67.80 - 68.09) ms | 71.40 ± (71.27 - 71.53) ms | +5.1% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 7.67 ± (7.66 - 7.67) MB | 7.69 ± (7.68 - 7.70) MB | +0.3% | ✅⬆️ |
| runtime.dotnet.threads.count | 10 ± (10 - 10) | 10 ± (10 - 10) | +0.0% | ✅ |
| .NET 8 - Bailout | ||||
| process.internal_duration_ms | 18.71 ± (18.68 - 18.73) ms | 19.19 ± (19.15 - 19.23) ms | +2.6% | ✅⬆️ |
| process.time_to_main_ms | 69.13 ± (69.02 - 69.24) ms | 72.51 ± (72.33 - 72.68) ms | +4.9% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 7.76 ± (7.75 - 7.77) MB | 7.74 ± (7.73 - 7.75) MB | -0.2% | ✅ |
| runtime.dotnet.threads.count | 11 ± (11 - 11) | 11 ± (11 - 11) | +0.0% | ✅ |
| .NET 8 - CallTarget+Inlining+NGEN | ||||
| process.internal_duration_ms | 153.29 ± (152.58 - 154.01) ms | 159.15 ± (158.38 - 159.91) ms | +3.8% | ✅⬆️ |
| process.time_to_main_ms | 477.64 ± (476.73 - 478.56) ms | 491.72 ± (490.96 - 492.49) ms | +2.9% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 36.90 ± (36.87 - 36.92) MB | 37.01 ± (36.99 - 37.02) MB | +0.3% | ✅⬆️ |
| runtime.dotnet.threads.count | 28 ± (28 - 28) | 28 ± (28 - 28) | +0.1% | ✅⬆️ |
HttpMessageHandler
| Metric | Master (Mean ± 95% CI) | Current (Mean ± 95% CI) | Change | Status |
|---|---|---|---|---|
| .NET Framework 4.8 - Baseline | ||||
| duration | 192.79 ± (192.85 - 193.66) ms | 207.02 ± (207.19 - 208.19) ms | +7.4% | ❌⬆️ |
| .NET Framework 4.8 - Bailout | ||||
| duration | 196.20 ± (195.92 - 196.62) ms | 212.29 ± (212.31 - 213.48) ms | +8.2% | ❌⬆️ |
| .NET Framework 4.8 - CallTarget+Inlining+NGEN | ||||
| duration | 1158.67 ± (1160.42 - 1168.44) ms | 1214.21 ± (1213.79 - 1219.84) ms | +4.8% | ✅⬆️ |
| .NET Core 3.1 - Baseline | ||||
| process.internal_duration_ms | 187.03 ± (186.69 - 187.37) ms | 203.04 ± (202.50 - 203.58) ms | +8.6% | ✅⬆️ |
| process.time_to_main_ms | 80.51 ± (80.27 - 80.75) ms | 87.35 ± (87.08 - 87.62) ms | +8.5% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 3 ± (3 - 3) | 3 ± (3 - 3) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 16.11 ± (16.07 - 16.14) MB | 15.93 ± (15.91 - 15.95) MB | -1.1% | ✅ |
| runtime.dotnet.threads.count | 20 ± (20 - 20) | 20 ± (20 - 20) | +1.2% | ✅⬆️ |
| .NET Core 3.1 - Bailout | ||||
| process.internal_duration_ms | 186.97 ± (186.60 - 187.34) ms | 203.14 ± (202.53 - 203.75) ms | +8.6% | ✅⬆️ |
| process.time_to_main_ms | 82.01 ± (81.85 - 82.17) ms | 88.69 ± (88.43 - 88.95) ms | +8.2% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 3 ± (3 - 3) | 3 ± (3 - 3) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 16.16 ± (16.13 - 16.18) MB | 16.02 ± (16.00 - 16.03) MB | -0.9% | ✅ |
| runtime.dotnet.threads.count | 21 ± (20 - 21) | 21 ± (21 - 21) | +1.6% | ✅⬆️ |
| .NET Core 3.1 - CallTarget+Inlining+NGEN | ||||
| process.internal_duration_ms | 391.58 ± (390.14 - 393.02) ms | 412.83 ± (411.53 - 414.14) ms | +5.4% | ✅⬆️ |
| process.time_to_main_ms | 521.25 ± (520.06 - 522.45) ms | 552.42 ± (551.31 - 553.54) ms | +6.0% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 3 ± (3 - 3) | 3 ± (3 - 3) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 58.43 ± (58.22 - 58.64) MB | 59.02 ± (58.98 - 59.06) MB | +1.0% | ✅⬆️ |
| runtime.dotnet.threads.count | 30 ± (30 - 30) | 30 ± (30 - 30) | +0.4% | ✅⬆️ |
| .NET 6 - Baseline | ||||
| process.internal_duration_ms | 191.92 ± (191.61 - 192.24) ms | 211.41 ± (210.60 - 212.23) ms | +10.2% | ✅⬆️ |
| process.time_to_main_ms | 70.05 ± (69.87 - 70.23) ms | 76.89 ± (76.64 - 77.15) ms | +9.8% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 16.06 ± (15.91 - 16.22) MB | 16.23 ± (16.21 - 16.26) MB | +1.1% | ✅⬆️ |
| runtime.dotnet.threads.count | 18 ± (18 - 18) | 19 ± (19 - 19) | +6.9% | ✅⬆️ |
| .NET 6 - Bailout | ||||
| process.internal_duration_ms | 190.73 ± (190.44 - 191.01) ms | 211.74 ± (210.99 - 212.48) ms | +11.0% | ✅⬆️ |
| process.time_to_main_ms | 70.86 ± (70.73 - 70.98) ms | 78.27 ± (78.04 - 78.49) ms | +10.5% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 16.29 ± (16.19 - 16.40) MB | 16.27 ± (16.25 - 16.29) MB | -0.2% | ✅ |
| runtime.dotnet.threads.count | 19 ± (19 - 20) | 21 ± (20 - 21) | +6.2% | ✅⬆️ |
| .NET 6 - CallTarget+Inlining+NGEN | ||||
| process.internal_duration_ms | 413.43 ± (412.12 - 414.73) ms | 441.88 ± (440.44 - 443.32) ms | +6.9% | ✅⬆️ |
| process.time_to_main_ms | 523.97 ± (522.53 - 525.41) ms | 561.95 ± (560.72 - 563.17) ms | +7.2% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 60.94 ± (60.90 - 60.99) MB | 60.92 ± (60.87 - 60.97) MB | -0.0% | ✅ |
| runtime.dotnet.threads.count | 31 ± (30 - 31) | 31 ± (31 - 31) | +1.1% | ✅⬆️ |
| .NET 8 - Baseline | ||||
| process.internal_duration_ms | 190.20 ± (189.80 - 190.61) ms | 207.67 ± (207.17 - 208.16) ms | +9.2% | ✅⬆️ |
| process.time_to_main_ms | 69.52 ± (69.33 - 69.72) ms | 75.55 ± (75.36 - 75.74) ms | +8.7% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 11.75 ± (11.73 - 11.78) MB | 11.59 ± (11.57 - 11.60) MB | -1.4% | ✅ |
| runtime.dotnet.threads.count | 18 ± (18 - 18) | 19 ± (19 - 19) | +3.5% | ✅⬆️ |
| .NET 8 - Bailout | ||||
| process.internal_duration_ms | 188.96 ± (188.44 - 189.48) ms | 208.77 ± (208.18 - 209.36) ms | +10.5% | ✅⬆️ |
| process.time_to_main_ms | 70.72 ± (70.52 - 70.92) ms | 77.55 ± (77.36 - 77.73) ms | +9.7% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 11.76 ± (11.69 - 11.83) MB | 11.63 ± (11.61 - 11.64) MB | -1.1% | ✅ |
| runtime.dotnet.threads.count | 19 ± (19 - 19) | 20 ± (20 - 20) | +3.5% | ✅⬆️ |
| .NET 8 - CallTarget+Inlining+NGEN | ||||
| process.internal_duration_ms | 340.13 ± (339.04 - 341.22) ms | 400.46 ± (393.21 - 407.72) ms | +17.7% | ✅⬆️ |
| process.time_to_main_ms | 478.95 ± (478.09 - 479.81) ms | 520.75 ± (519.84 - 521.65) ms | +8.7% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 48.87 ± (48.83 - 48.91) MB | 49.45 ± (49.29 - 49.61) MB | +1.2% | ✅⬆️ |
| runtime.dotnet.threads.count | 30 ± (30 - 30) | 30 ± (30 - 30) | +0.1% | ✅⬆️ |
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 (8349) - mean (72ms) : 70, 75
master - mean (69ms) : 66, 72
section Bailout
This PR (8349) - mean (76ms) : 74, 78
master - mean (80ms) : 69, 91
section CallTarget+Inlining+NGEN
This PR (8349) - mean (1,079ms) : 1035, 1123
master - mean (1,054ms) : 999, 1109
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 (8349) - mean (113ms) : 110, 117
master - mean (107ms) : 104, 110
section Bailout
This PR (8349) - mean (115ms) : crit, 112, 117
master - mean (108ms) : 106, 110
section CallTarget+Inlining+NGEN
This PR (8349) - mean (796ms) : 775, 817
master - mean (777ms) : 751, 802
FakeDbCommand (.NET 6)
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8349) - mean (100ms) : 97, 103
master - mean (95ms) : 92, 97
section Bailout
This PR (8349) - mean (101ms) : 98, 103
master - mean (95ms) : 93, 98
section CallTarget+Inlining+NGEN
This PR (8349) - mean (788ms) : 769, 807
master - mean (760ms) : 736, 784
FakeDbCommand (.NET 8)
gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8349) - mean (98ms) : 96, 101
master - mean (93ms) : 90, 96
section Bailout
This PR (8349) - mean (99ms) : 97, 102
master - mean (94ms) : 93, 96
section CallTarget+Inlining+NGEN
This PR (8349) - mean (688ms) : 666, 710
master - mean (661ms) : 645, 677
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 (8349) - mean (208ms) : 201, 215
master - mean (193ms) : 189, 197
section Bailout
This PR (8349) - mean (213ms) : crit, 204, 222
master - mean (196ms) : 193, 200
section CallTarget+Inlining+NGEN
This PR (8349) - mean (1,217ms) : 1173, 1260
master - mean (1,164ms) : 1107, 1222
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 (8349) - mean (300ms) : 291, 309
master - mean (276ms) : 270, 282
section Bailout
This PR (8349) - mean (302ms) : crit, 290, 314
master - mean (277ms) : 272, 282
section CallTarget+Inlining+NGEN
This PR (8349) - mean (1,000ms) : crit, 961, 1039
master - mean (942ms) : 923, 961
HttpMessageHandler (.NET 6)
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8349) - mean (298ms) : 280, 315
master - mean (270ms) : 266, 274
section Bailout
This PR (8349) - mean (300ms) : crit, 285, 315
master - mean (269ms) : 265, 274
section CallTarget+Inlining+NGEN
This PR (8349) - mean (1,040ms) : crit, 1013, 1067
master - mean (965ms) : 943, 988
HttpMessageHandler (.NET 8)
gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8349) - mean (294ms) : 284, 303
master - mean (269ms) : 263, 275
section Bailout
This PR (8349) - mean (297ms) : crit, 287, 307
master - mean (269ms) : 262, 276
section CallTarget+Inlining+NGEN
This PR (8349) - mean (955ms) : crit, 847, 1063
master - mean (850ms) : 829, 871
7b1aeb3 to
c5501e0
Compare
Summary of changes
SourceLinkUrlParserimplementationsSpanCharSplitterinstead ofString.Split()Reason for change
@lucaspimentel flagged this as an option in #8332, as it will reduce allocations. As this is something we do for every app, it makes sense to optimize.
Implementation details
Splitusages withSpanCharSplitterThere's still some allocations we could potentially remove, by doing some dangerous stuff (like we do in
UriHelpers, to avoid hittingAbsolutePathetc) but I don't know that the payoff is worth it here. Fewer allocations is better, but it's not worth going overboard IMO.Test coverage
Benchmark code
Other details
Stacked on #8332 for simplicity