Skip to content

Uri path compression is O(n^2) #117777

@MihaZupan

Description

@MihaZupan

Our path compression (e.g. removing /../) algorithm is O(n^2) right now.
This wasn't an issue before since the length was limited to 64k. With #117287 we no longer have such a limit, so this could be problematic as N grows.
We should rewrite that into something linear before .NET 10 ships.

private static int Compress(Span<char> span, UriParser syntax)

#117287 (comment)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions