4 ms·
Can anyone comment if reimplementing it in C# would bring performance benefits over system.string?
by polskibus 9y ago
Can anyone comment if reimplementing it in C# would bring performance benefits over system.string?
- newscracker 9y agoBased on a very quick look at the source code here and the source code of System.String [1], it looks like the .NET implementation should be faster and more comprehensive. It would be interesting to see a deeper analysis and comparison of these two. [1]: https://github.com/Microsoft/referencesource/blob/master/mscorlib/system/string.cs https://github.com/Microsoft/referencesource/blob/master/msc...
- manigandham 9y ago.NET already has a great string implementation in both the Framework and Core runtimes. If you're talking about manipulating strings in C# itself then the upcoming Span<T> and Memory<T> types will help greatly. Some of the new sockets implementations are already using these new interfaces.
- polskibus 9y agoAs far as I remember, Federico Lois in his Patterns for High Performance C#, described that in RavenDB they had to roll out they own string type for performance reasons. So I suppose there is still room for improvement in .NET when it comes to string. edit: link to the talk: https://www.youtube.com/watch?v=7GTpwgsmHgU https://www.youtube.com/watch?v=7GTpwgsmHgU