Skip to content

Eliminate IInternable in favor of ReadOnlySpan<char> for OpportunisticIntern inputs #5438

@ladipro

Description

@ladipro

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.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions