Repository navigation
Closed
Labels
Description
Run Information
| Architecture | x64 |
|---|---|
| OS | Windows 10.0.18362 |
| Baseline | a8ea8e67dc20689aa2e4c738a2f84ea3483ec872 |
| Compare | 129982ef61894433867f0ea593281fc069284ade |
| Diff | Diff |
Regressions in System.Tests.Perf_String
| Benchmark | Baseline | Test | Test/Base | Test Quality | Edge Detector | Baseline IR | Compare IR | IR Ratio | Baseline ETL | Compare ETL |
|---|---|---|---|---|---|---|---|---|---|---|
| IndexOfAny - Duration of single invocation | 7.79 ns | 12.61 ns | 1.62 | 0.06 | False |
Repro
git clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f net6.0 --filter 'System.Tests.Perf_String*'Related Issues
Regressions
- [Perf] Alpine/x64: 4 Regressions on 10/26/2022 10:56:11 AM
- [Perf] Windows/x64: 13 Regressions on 10/26/2022 10:56:11 AM
- [Perf] Windows/x64: 14 Regressions on 10/26/2022 10:56:11 AM
- [Perf] Linux/x64: 4 Regressions on 10/26/2022 10:56:11 AM
Improvements
- [Perf] Linux/x64: 1 Improvement on 10/26/2022 10:56:11 AM
- [Perf] Linux/arm64: 2 Improvements on 10/26/2022 10:56:11 AM
- [Perf] Windows/arm64: 2 Improvements on 10/26/2022 10:56:11 AM
- [Perf] Windows/arm64: 2 Improvements on 10/26/2022 10:56:11 AM
Details
Payloads
Histogram
Edge Detector Info
System.Tests.Perf_String.IndexOfAny
Description of detection logic
IsRegressionChecked: Marked as regression because the three check build points were 0.05 greater than the baseline.
IsImprovementBase: Marked as not an improvement because the compare was not 5% less than the baseline, or the value was too small.
IsRegressionBase: Marked as regression because the compare was 5% greater than the baseline, and the value was not too small.
IsRegressionWindowed: Marked as regression because 12.611276363670004 > 8.183525362767785.
IsChangePoint: Marked as a change because one of 10/26/2022 7:11:30 AM, 11/1/2022 10:15:31 AM falls between 10/23/2022 1:14:54 PM and 11/1/2022 10:15:31 AM.
IsRegressionStdDev: Marked as regression because -35.25211814755959 (T) = (0 -11.46909107970713) / Math.Sqrt((0.006840580727820924 / (25)) + (0.2897007455461371 / (27))) is less than -2.0085591120996775 = MathNet.Numerics.Distributions.StudentT.InvCDF(0, 1, (25) + (27) - 2, .025) and -0.47583294510231 = (7.771266468720857 - 11.46909107970713) / 7.771266468720857 is less than -0.05.
IsImprovementBase: Marked as not an improvement because the compare was not 5% less than the baseline, or the value was too small.
IsChangeEdgeDetector: Marked not as a regression because Edge Detector said so.
IsChangeEdgeDetector: Marked not as a regression because Edge Detector said so.
Docs
Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository

Activity
kunalspathak commentedon Nov 4, 2022
#76803
@stephentoub
2 remaining items
kunalspathak commentedon Nov 4, 2022
There are other regressions/improvements in the linked issues.
[-][Perf] Windows/x64: 1 Regression on 10/26/2022 10:56:11 AM[/-][+][Perf] Windows/x64: 1 Regression in IndexOfAny[/+]stephentoub commentedon Nov 4, 2022
That PR is adding new methods, not updating existing ones.
More likely is #75754, which changes existing IndexOfAny methods.
cc: @adamsitnik
kunalspathak commentedon Nov 4, 2022
Ah sorry, I missed that.
kunalspathak commentedon Nov 4, 2022
dotnet/perf-autofiling-issues#9392 is interesting one too:
Rob-Hague commentedon Nov 5, 2022
It does appear to be #75754 (3e40074)
Rob-Hague commentedon Nov 8, 2022
The change at https://github.com/Rob-Hague/runtime/tree/indexofany-ros appears to solve the regression. It is not super pretty given the work on deduplication with generics. I did play with generics ala
runtime/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs
Lines 706 to 716 in e029499
but I was just adding complexity/indirection when ultimately it needs to become "un-generic" at some point (the complication here is the extra 4- and 5-value specialisations which only exist as helpers in.SpanHelpers, along with the different fallbacks per type)Edit: the tricky bit is that there is no non-value type helpers for 4- and 5- value "between" the 3- value:
runtime/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.T.cs
Line 493 in 1366574
and the
(ref, count, ref, count)helper:runtime/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.T.cs
Line 598 in 1366574
so when you have a pattern like this:
the fallback in the private helper after an
IsBitwiseEquatablebranch is not so obvious. So I was unsure how to proceed there. I don't doubt there is a nicer solution ("I've tried nothing and I'm all out of ideas!") but I can open a PR with these changes if they look OK.Wall of benchmarks below. I added "LastIndex.." variants to the benchmark project locally. The comparisons are:
[AggressiveInlining]not added to the extra methods. Its favourability swings around a bit but it is probably beneficial to have the annotation on balance (purely from a time perspective)Details
String:
Byte:
Char:
int:
tannergooding commentedon Aug 7, 2023
We're currently sitting at 8ns and this is nearly a year old now. I don't think there is really anything actionable for us to do here at this point.