Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@jkotas
Copy link
Member

@jkotas jkotas commented May 5, 2018

This makes the code smaller and faster. For example, the following is about 1.4x faster with this change:

ReadOnlySpan<char> s1 = "Hello world";
ReadOnlySpan<char> s2 = "world";
for (int i = 0; i < 100000000; i++) s1.EndsWith(s2, StringComparison.OrdinalIgnoreCase);

Also, I have ported GetCaseCompareOfComparisonCulture code size optimization from #16434 while I was on it because of it fit well with the rest of the changes.

Edit: The implementation had a bug. The improvement for above example is only 1.4x.

@jkotas jkotas requested a review from ahsonkhan May 5, 2018 01:22
@jkotas
Copy link
Member Author

jkotas commented May 5, 2018

@dotnet-bot test Windows_NT x64 Checked corefx_baseline
@dotnet-bot test Ubuntu x64 Checked corefx_baseline

@jkotas
Copy link
Member Author

jkotas commented May 5, 2018

cc @benaadams

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent. Too bad this isn't in 2.1.

Copy link
Member

@benaadams benaadams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@jkotas jkotas force-pushed the unnecessary-span-helpers branch from d8724b1 to d08e613 Compare May 5, 2018 06:40
@jkotas jkotas force-pushed the unnecessary-span-helpers branch from d08e613 to db979b6 Compare May 5, 2018 06:43
@jkotas
Copy link
Member Author

jkotas commented May 5, 2018

@dotnet-bot test Windows_NT x64 Checked corefx_baseline

@jkotas
Copy link
Member Author

jkotas commented May 5, 2018

@dotnet-bot test Windows_NT x64 Checked corefx_baseline

@jkotas
Copy link
Member Author

jkotas commented May 5, 2018

@dotnet-bot test Ubuntu x64 Checked corefx_baseline

@jkotas jkotas merged commit 0ba6924 into dotnet:master May 6, 2018
@jkotas jkotas deleted the unnecessary-span-helpers branch May 6, 2018 02:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants