-
Notifications
You must be signed in to change notification settings - Fork 473
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
Performance optimizations for SvgColourConverter parser #806
Performance optimizations for SvgColourConverter parser #806
Conversation
This is quick fix, the color is correct, jut Name is not resolved, the source string is hex and does not have a name.
This code generator is run manually
Looking at your benchmark results on the Pull request SvgColourConverter_Parse_system_colors_single_DIRECT_first seems to be slower in than old implementation |
That is special case and really hard to make it faster than original I will do benchmarks later, I think net5.0 has some optimizations for that case, I have done a lot to make it fast. The ReadOnlySpan unfortunately does not have switch statement support yet. |
Would it be possible to Make the Lookup Dictionary CaseInsensitive and avoid the ToLowerAscii call? var caseInsensitiveDictionary = new Dictionary<string,...>(StringComparer.OrdinalIgnoreCase); |
I think this can now be merged because. The Roslyn Compiler can soon do switches on ReadonlySpans |
Reference Issue
Split from #786
Fixes: #795
What does this implement/fix? Explain your changes.
Performance optimization for
Any other comments?
dotnet run -c Release -f netcoreapp3.1 -- -f '*SvgColourConverter_Parse_html_4*'
dotnet run -c Release -f netcoreapp3.1 -- -f '*SvgColourConverter_Parse_system_colors_single_*'
dotnet run -c Release -f netcoreapp3.1 -- -f '*SvgColourConverter_Parse_system_colors_single_DIRECT*'
dotnet run -c Release -f netcoreapp3.1 -- -f '*SvgColourConverter_Parse_hex_rgb*'
dotnet run -c Release -f netcoreapp3.1 -- -f '*SvgColourConverter_Parse_hex_rrggbb*'
dotnet run -c Release -f netcoreapp3.1 -- -f '*SvgColourConverter_Parse_rgb_integer_range*'
dotnet run -c Release -f netcoreapp3.1 -- -f '*SvgColourConverter_Parse_rgb_float_range*'
dotnet run -c Release -f netcoreapp3.1 -- -f '*SvgColourConverter_Parse_rgb_hsl*'