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#.
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.
@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.
Closing as from @jkotas response above there is nothing left to be done here. @jamesqo feel free to reopen if you think otherwise.
Most helpful comment
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.