Skip to content
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

Remove char[] allocation in CheckIriUnicodeRange #33641

Merged
merged 1 commit into from Nov 22, 2018

Conversation

@stephentoub
Copy link
Member

commented Nov 21, 2018

We can trivially remove a char[2] allocation by replacing it with a stackalloc'd span. We could likely go further and avoid the subsequent string allocation as well, but we'd want to do perf validation of that, given the sheer number of CompareOrdinal calls that follow.

cc: @davidsh, @GrabYourPitchforks

We can trivially remove a char[2] allocation by replacing it with a stackalloc'd span.  We could likely go further and avoid the subsequent string allocation as well, but we'd want to do perf validation of that, given the sheer number of CompareOrdinal calls that follow.
@stephentoub

This comment has been minimized.

Copy link
Member Author

commented Nov 21, 2018

The failures are because we still have some Pal/Unit tests building for netstandard. I'm just going to remove all of those configurations, as they don't add value.

@stephentoub

This comment has been minimized.

Copy link
Member Author

commented Nov 22, 2018

@dotnet-bot test this please

@stephentoub stephentoub merged commit 2f8cd58 into dotnet:master Nov 22, 2018
14 checks passed
14 checks passed
Linux arm Release Build Build finished.
Details
Linux arm64 Release Build Build finished.
Details
Linux x64 Release Build Build finished.
Details
Linux-musl x64 Debug Build Build finished.
Details
NETFX x86 Release Build Build finished.
Details
OSX x64 Debug Build Build finished.
Details
Packaging All Configurations x64 Debug Build Build finished.
Details
Tizen armel Debug Build Build finished.
Details
UWP CoreCLR x64 Debug Build Build finished.
Details
UWP NETNative x86 Release Build Build finished.
Details
WIP Ready for review
Details
Windows x64 Debug Build Build finished.
Details
Windows x86 Release Build Build finished.
Details
license/cla All CLA requirements met.
@stephentoub stephentoub deleted the stephentoub:irichars branch Nov 22, 2018
@pentp

This comment has been minimized.

Copy link
Collaborator

commented Nov 22, 2018

The correct and fast solution would be to use Char.ConvertToUtf32 and avoid strings altogether.

jlennox added a commit to jlennox/corefx that referenced this pull request Dec 16, 2018
We can trivially remove a char[2] allocation by replacing it with a stackalloc'd span.  We could likely go further and avoid the subsequent string allocation as well, but we'd want to do perf validation of that, given the sheer number of CompareOrdinal calls that follow.
@karelz karelz added this to the 3.0 milestone Dec 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.