-
Notifications
You must be signed in to change notification settings - Fork 5k
[Perf -10%] System.Text.RegularExpressions.Tests.Perf_Regex_Common (2) #40094
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
Comments
@DrewScoggins thanks for the tightly bounded diff. IThere were no regex changes since July 16th. There are only two commits in that diff that are even slightly plausibly related @davidwrighton Fix CanCastTo behavior (#39915) … 13fa14e eyeballing the raw graph, I get a slightly larger bracket. This change may also have been in those bounds: @davidwrighton Fix issue in type equivalence involving arrays (#39914) … 90989b4 @davidwrighton @erozenfeld can you conceive of either of these causing this regression? |
Looking at the 2nd test, I think @DrewScoggins tighter bracket is the correct one. @DrewScoggins did you see any other regressions in other scenarios during those 3 hours, can you check? |
I believe that this test also regressed during the same gap, #40088 |
OK, I'm inclined to put this in codegen area, but I am interested in @erozenfeld thoughts. |
#39878 had codegen diffs in |
OK thanks @erozenfeld |
Hooray for (1) prompt detection of a performance regression (2) useful issue that allowed us to narrow it down quickly |
In dotnet#39878 I switched fgUpdateChangedFlowGraph to call fgComputeReachability, which both removes unreachable blocks and calls fgComputeDoms. As mentioned in that PR, in addition to removing unreachable blocks fgRemoveUnreachableBlocks updates `BBF_LOOP_HEAD` flags even if no unreachable blocks were found. That resulted in some diffs, both positive and negative, from downstream effects: e.g., in some cases we now recognize more loops, which changes weights, etc. Some of the negative diffs affected benchmarks we are tracking, e.g., in dotnet#40094 `System.Text.RegularExpressions.Tests.Perf_Regex_Common` had a 10% regression because of codegen diffs in the large dynamic method created when compiling regular expressions. Because of these regressions, I decided to go with a more surgical fix for the original issue (assert when computing dominators after inlining GC polls). The downstream phases don't really need the dominator info so I changed fgUpdateChangedFlowGraph to not re-compute dominators after GC poll inlining. This reverses all diffs from dotnet#39878 and fixes dotnet#40094.
In #39878 I switched fgUpdateChangedFlowGraph to call fgComputeReachability, which both removes unreachable blocks and calls fgComputeDoms. As mentioned in that PR, in addition to removing unreachable blocks fgRemoveUnreachableBlocks updates `BBF_LOOP_HEAD` flags even if no unreachable blocks were found. That resulted in some diffs, both positive and negative, from downstream effects: e.g., in some cases we now recognize more loops, which changes weights, etc. Some of the negative diffs affected benchmarks we are tracking, e.g., in #40094 `System.Text.RegularExpressions.Tests.Perf_Regex_Common` had a 10% regression because of codegen diffs in the large dynamic method created when compiling regular expressions. Because of these regressions, I decided to go with a more surgical fix for the original issue (assert when computing dominators after inlining GC polls). The downstream phases don't really need the dominator info so I changed fgUpdateChangedFlowGraph to not re-compute dominators after GC poll inlining. This reverses all diffs from #39878 and fixes #40094.
Looking even closer at the graph and zooming in, we actually could get a diff bounding just 3 hours of time on July 24th: |
In dotnet#39878 I switched fgUpdateChangedFlowGraph to call fgComputeReachability, which both removes unreachable blocks and calls fgComputeDoms. As mentioned in that PR, in addition to removing unreachable blocks fgRemoveUnreachableBlocks updates `BBF_LOOP_HEAD` flags even if no unreachable blocks were found. That resulted in some diffs, both positive and negative, from downstream effects: e.g., in some cases we now recognize more loops, which changes weights, etc. Some of the negative diffs affected benchmarks we are tracking, e.g., in dotnet#40094 `System.Text.RegularExpressions.Tests.Perf_Regex_Common` had a 10% regression because of codegen diffs in the large dynamic method created when compiling regular expressions. Because of these regressions, I decided to go with a more surgical fix for the original issue (assert when computing dominators after inlining GC polls). The downstream phases don't really need the dominator info so I changed fgUpdateChangedFlowGraph to not re-compute dominators after GC poll inlining. This reverses all diffs from dotnet#39878 and fixes dotnet#40094.
Run Information
Regressions in System.Text.RegularExpressions.Tests.Perf_Regex_Common
Historical Data in Reporting System
Repro
Histogram
System.Text.RegularExpressions.Tests.Perf_Regex_Common.Email_IsNotMatch(Options: IgnoreCase, Compiled)
System.Text.RegularExpressions.Tests.Perf_Regex_Common.Email_IsMatch(Options: IgnoreCase, Compiled)
Docs
Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository
The text was updated successfully, but these errors were encountered: