[mscorlib] Moving more of the String functions to managed code #4703

Open
jamesqo opened this Issue May 1, 2016 · 2 comments

Projects

None yet

5 participants

@jamesqo
Contributor
jamesqo commented May 1, 2016

As it stands, many 'high-level' string functions like IndexOf, LastIndexOf, Replace etc. are implemented natively when they could be written in managed code. I noticed this was done with one of the string.Replace overloads in f007485, so maybe it would be good to do this to make the code more accessible to newcomers, if they aren't familiar with how the C++ code maps to C#.

@jamesqo jamesqo changed the title from Moving more of the String functions to managed code to [mscorlib] Moving more of the String functions to managed code May 1, 2016
@jkotas
Member
jkotas commented May 1, 2016

We have looked into this in the past and moved everything that could be moved without significant perf loss. Moving more depends on having pretty good managed optimizations for all coreclr architectures.

This makes sense to consider only once RyuJIT or better codegen is available for all architectures that coreclr runs on (x86, x64, arm, arm64).

BTW: The managed implementations of all string methods are available in corert repo.

@jamesqo
Contributor
jamesqo commented May 1, 2016 edited

@jkotas Ah, so that's why the implementations in the corert repo are managed; since it's compiled AOT and optimized by the C++ compiler, they get better codegen than the JIT implementation which is still a work-in-progress for some of the platforms you mention (arm, arm64). Thanks for clearing that up, makes sense now.

@sergiy-k sergiy-k modified the milestone: Future Jun 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment