Most IInternable implementations can already be represented as ReadOnlySpan<char> and are thus redundant. The StringBuilder based implementations are problematic from performance point of view in that they're indexing into the StringBuilder as iterating over its characters could be an O(N^2) operation.
We should:
- Delete IInternable.
- Convert the non-
StringBuilder uses to ReadOnlySpan<char>.
- Figure out how to address
StringBuilder implementations.
- On .NET Core we could use the new GetChunks() method.
- Or we could simply convert the
StringBuilder to string and verify that the perf win outweighs the cost of the string allocation.
Most
IInternableimplementations can already be represented asReadOnlySpan<char>and are thus redundant. TheStringBuilderbased implementations are problematic from performance point of view in that they're indexing into theStringBuilderas iterating over its characters could be an O(N^2) operation.We should:
StringBuilderuses toReadOnlySpan<char>.StringBuilderimplementations.StringBuilderto string and verify that the perf win outweighs the cost of the string allocation.