Files
Cory Benfield 326f7f9a8c Simplify the canonicalForm subscript further. (#310)
Motivation:

The canonicalForm subscript was written for clarity, but it didn't do a
good job of avoiding performance costs. Unfortunately, this function can
be a bit costly, for two reasons. Firstly, it used a bunch of eager
collection operations, such that it would allocate intermediate arrays.
Secondly, it computed on the String, rather than the UTF8View backing
that string, in order to perform those collection operations. The result
was that it spent a bit too much time messing about with the headers
than it needed to.

Modifications:

- Define a lazy UTF8 view splitting sequence and use it.
- Change to compute on the UTF8View.

Result:

Better performance in the canonicalForm subscript.
2021-09-29 15:00:31 +01:00
..