-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Perf -26%] System.Tests.Perf_String (4) #37816
Comments
@DrewScoggins is there some way to close the gap in the graph? Are we missing all perf data from Dec-April or were just these tests broken? Ideally we would see which build it regressed in. |
The tests are not broken. We are also not missing any data. In general, for comparisons that span many months we try not to put every point in the graph. I will regenerate the graphs that do not show the actual move and update the issues accordingly. |
Thanks @DrewScoggins. Looks like you did this. Can you clarify the Legend on the graph? The purple and orange lines have build numbers, but I think I would expect the build number to be changing every day. My mental picture is there's a single line, with a datapoint every day, is that wrong? |
In the case of scenarios like this that are likely affected by the ICU change, a superimposed Linux measurement would likely be interesting - for example, we might see that Windows now matches Linux. (Whether we're OK with that is a separate issue) |
Yeah, I should probably change the legend as it doesn't make sense here outside the context of the full report. You are correct in thinking that these are about one build per day. Also yeah, I can take a look at building out graphs that have the Windows vs Linux comparison so we can see how we look compared to that as well. I will post those in the relevant issues. |
One other feedback, it would be good in these issue to clarify what the diff link represents. In the graphs above, it seems clear that there are 3 distinct regressions across these scenarios -- Dec, early Jan, and early March. The single diff link provided above covers 7 months , and it's out of the dotnet/installer repo. It's so huge that I get a Unicorn trying to view it. What might be ideal is 3 diff links, each of ~1 week or less out of the dotnet/runtime repo. cc @adamsitnik @tannergooding since I know you guys are collectively tuning these issues. |
@danmosemsft I am focusing on the ordinal ignore casing (the high priority issue). This issue is not ordinal. I cannot cache all possible casing for all possible cultures. The best we can do here is to look if there is a way to optimize when calling ICU. |
FWIW The System.Tests.Perf_String.Replace_Char(text: "Hello", oldChar: 'l', newChar: '!')
|
@tarekgh Do you want to leave this open for 5.0.0 or should we move to 6.0.0/Future? |
@jeffhandley please move them to 6.0 for now and we can bring it back if we'll address it soon. |
I suspect that #279 impacted the performance for this particular case - the minimum size of the string for entering the vectorised path is 8 Do we believe this change is worth it? While it definitely does benefit long strings, it might be useful to collect informations on the length of the string that this method usually gets called with, and see if the majority of the strings are short enough to not enter the vectorised path. Another thing to consider might be whether we think the difference in actual nanoseconds are significant enough, since while those added initial set-up overheads are likely to overwhelm the difference in percentages it might be not that much of the time lost. I'm seeing regressions of between 0.6ns best case and 18ns worst case (assuming those are in nanoseconds). I think this is something that's going to show up fairly frequently with vectorisations of variable-length data in general. For example, we had the same issue with |
I wonder if there is something we could do for vectorized code paths that would allow the initial size check to be optimized away. That is, much of the code is in a pattern such as:
If C++ allows you to specialize for these cases using templates, but we don't have an equivalent in .NET today and so you can't really say "Do this if the input is 4 bytes and this if the input is greater than 128 bytes" |
@tarekgh, Looks like I didn't forget to include a benchmark in the original PR fortunately so yes: dotnet/coreclr#27798 Specifically, dotnet/coreclr#27798 (comment) is the relevant part. Quoting the comment from below - you can see the exact same case regressing on my machine which has i7-8700. Not exactly sure which version of Windows I used at the time but it was one of the 10 Insider builds.
(Also ran |
Thanks @Gnbrkm41 for the details. Do we have some idea about the min string length that we start see the perf improvement with? @tannergooding looks data.Length looks is not constant I guess which means inlining the method wouldn't help according to your comment. is there any other idea can be tried? |
This method allocates new strings. It makes it unlikely to be used in the most performance critical scenarios. It is nice that it is vectorized and significantly faster on long strings now, but I do not think it is worth it to spend time on this or making the code more complex to match the earlier performance for small strings. |
sounds good. I am closing this one and we can revisit if the issue raised in any customer scenario. |
Run Information
Regressions in System.Tests.Perf_String
Historical Data in Reporting System
Repro
Histogram
System.Tests.Perf_String.ToLower(s: "TEST")
System.Tests.Perf_String.IndexerCheckBoundCheckHoist
System.Tests.Perf_String.ToUpper(s: "TeSt")
System.Tests.Perf_String.Replace_Char(text: "Hello", oldChar: 'l', newChar: '!')
Docs
Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository
The text was updated successfully, but these errors were encountered: