Repository navigation
Regressions in System.Globalization.Tests.StringSearch #91938
Copy link
Copy link
Closed
Labels
PGOPriority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releasearch-x64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is mergedos-windowsruntime-coreclrspecific to the CoreCLR runtimespecific to the CoreCLR runtimetenet-performancePerformance related issuePerformance related issuetenet-performance-benchmarksIssue from performance benchmarkIssue from performance benchmark
Milestone
Description
Run Information
| Name | Value |
|---|---|
| Architecture | x64 |
| OS | Windows 10.0.19042 |
| Queue | OwlWindows |
| Baseline | 538cd03b39afb57eb17ea77a86b3c94c039b8822 |
| Compare | c7d36b48a493789c9267069645e2690e804a2067 |
| Diff | Diff |
| Configs | CompilationMode:tiered, RunKind:micro |
Regressions in System.Globalization.Tests.StringSearch
| Benchmark | Baseline | Test | Test/Base | Test Quality | Edge Detector | Baseline IR | Compare IR | IR Ratio |
|---|---|---|---|---|---|---|---|---|
| 397.12 ns | 516.40 ns | 1.30 | 0.03 | False |
Repro
General Docs link: https://github.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md
git clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Globalization.Tests.StringSearch*'Details
Payloads
System.Globalization.Tests.StringSearch.LastIndexOf_Word_NotFound(Options: (en-US, OrdinalIgnoreCase, False))
ETL Files
Histogram
Description of detection logic
IsRegressionBase: Marked as regression because the compare was 5% greater than the baseline, and the value was not too small.
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.
IsRegressionChecked: Marked as regression because the three check build points were 0.05 greater than the baseline.
IsRegressionWindowed: Marked as regression because 516.3989242627822 > 416.48485541506614.
IsChangePoint: Marked as a change because one of 6/22/2023 7:55:14 AM, 8/27/2023 2:42:29 PM, 9/4/2023 9:28:57 AM falls between 8/26/2023 7:53:22 PM and 9/4/2023 9:28:57 AM.
IsRegressionStdDev: Marked as regression because -523.7204883102902 (T) = (0 -516.5964530091254) / Math.Sqrt((0.39932907677050516 / (9)) + (0.19792037708236598 / (24))) is less than -2.0395134463927462 = MathNet.Numerics.Distributions.StudentT.InvCDF(0, 1, (9) + (24) - 2, .025) and -0.30301021705518705 = (396.4638544252073 - 516.5964530091254) / 396.4638544252073 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.
JIT Disasms
Docs
Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
PGOPriority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releasearch-x64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is mergedos-windowsruntime-coreclrspecific to the CoreCLR runtimespecific to the CoreCLR runtimetenet-performancePerformance related issuePerformance related issuetenet-performance-benchmarksIssue from performance benchmarkIssue from performance benchmark

Activity
cincuranet commentedon Sep 12, 2023
Windows x64 Intel and AMD both are stable-regressed. Transfering.
[-][Perf] Windows/x64: 1 Regression on 8/28/2023 8:13:19 AM[/-][+]Regressions in System.Globalization.Tests.StringSearch[/+]8 remaining items
AndyAyersMS commentedon Jun 28, 2024
Commit range is f5881e5...a7d4b4b
Seems like a static PGO update lead to this one.
AndyAyersMS commentedon Jul 9, 2024
At least locally this improved and then re-regressed
AndyAyersMS commentedon Jul 10, 2024
Need to do more digging but certainly looks like a layout issue. Raw sample attribution
Note in particular the heavy sample count at the end of the .NET 9 code -- seems like a hot loop has gotten widely spread out.
This is an R2R'd method so went through Tier-1 instr and some some of its callees either will lack PGO or will have static PGO.
If we disable R2R we see 9.0 do pretty well..
OutlierMode=DontRemove EnvironmentVariables=DOTNET_ReadyToRun=0 PowerPlanMode=00000000-0000-0000-0000-000000000000
IterationTime=250ms MaxIterationCount=20 MemoryRandomization=True
MinIterationCount=15 WarmupCount=1
So part of the issue here is lost profile data from Tier-1 instr (in particular we lose dynamic pgo for inlinees). The "fix" for this is to instrument the inlinees as well.
AndyAyersMS commentedon Jul 10, 2024
Seems like the key missing info is from

System.Globalization.OrdinalCasing:ToUpper(ushort):ushortand when we synthesize we add weight to paths that aren't reached in the benchmark:AndyAyersMS commentedon Jul 29, 2024
I don't think there is an easy fix here. Because of our strategy for instrumenting R2R'd code we will miss some important details about behavior of inlinees.
#44372 tracks gathering profile data for inlinees when we are profiling and optimizing.
AndyAyersMS commentedon Jun 6, 2025
Updated ADX query
Looking at the past two years we have never recovered and even gotten worse over time
(win zen3)
(linux zen3)
AndyAyersMS commentedon Aug 7, 2025
Just to verify (again) this is lack of PGO from R2R:
We're not going to be able to fix this in .NET 10, but let's try and address #44372 which should resolve this.
JIT: enable instrumentation for inlinees (dotnet#119658)