kkebo / zyphy

Zyphy is (or will be) a fast web browser engine written in Swift.
MIT License
4 stars 1 forks source link

perf: avoid `Unicode.Scalar.Properties` #38

Closed kkebo closed 9 months ago

kkebo commented 9 months ago

The following computed properties call computed properties of Unicode.Scalar.Properties.

However, those computed properties call a computed property _binaryProperties, and it calls _swift_stdlib_getBinaryProperties. It contains unneeded code for an HTML tokenizer.

https://github.com/apple/swift/blob/98e65d015979c7b5a58a6ecf2d8598a6f7c85794/stdlib/public/stubs/Unicode/UnicodeScalarProps.cpp#L32

So I decided to avoid Unicode.Scalar.Properties.