-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed-up HTML escaping by using equal sized entities
By using codepoint entities like `'&'` → `"&"`, we have a much smaller lookup table (58 bytes instead of 29× pointer size ~= 232 bytes). This makes the cache happy, and the benchmark run about ~20% faster. ```text $ cargo bench --bench escape Escaping time: [3.4087 µs 3.4126 µs 3.4168 µs] change: [-19.790% -19.580% -19.354%] (p = 0.00 < 0.05) Performance has improved. ```
- Loading branch information
Showing
1 changed file
with
50 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters