While working on #69, I realised that we’re doing far more string copying than we should be. The built in Substring type is a perfect way to represent substrings as “real” strings in a performant way. MatchResult is a bundle of ranges that map onto a single string, and should really be exposing Substring in its API as much as possible to avoid the many unnecessary copies.
It would have been nice if I’d noticed this before 2.0, but unfortunately that ship has sailed. If we get another opportunity to make breaking changes, this is a perfect one.
While working on #69, I realised that we’re doing far more string copying than we should be. The built in
Substringtype is a perfect way to represent substrings as “real” strings in a performant way.MatchResultis a bundle of ranges that map onto a single string, and should really be exposingSubstringin its API as much as possible to avoid the many unnecessary copies.It would have been nice if I’d noticed this before 2.0, but unfortunately that ship has sailed. If we get another opportunity to make breaking changes, this is a perfect one.