-
-
Notifications
You must be signed in to change notification settings - Fork 548
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce memory reads when looking up MIME type from extension
Since, by construction, the extensions are stored sorted and sequentially in memory, if we're comparing only the strings found in the blob generated by mimegen, we can compare only the pointers; otherwise, fall back to two 64-bit reads, replacing the indirect call to strncmp(). The extensions are now stored in big-endian rather than in host-endian, making it possible to compare things properly. As a result, Brotli liked the input data a bit more and was able to save a bit over 50 bytes; it's not much, but, hey, savings are savings.
- Loading branch information
Showing
2 changed files
with
37 additions
and
27 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
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