-
Notifications
You must be signed in to change notification settings - Fork 806
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some CoreText perf low-hanging fruit (#1558)
- Remove NSLayoutManager __lineHasGlyphsAfterIndex(), which is called multiple times per line - Instead, directly search for the index of the last visible glyph once, compare against this - Was previously about ~10% of the CPU time of [NSLayoutManager __layoutAllText], now negligible - DWriteWrapper_CoreText - Skip first range of attributes in __DWriteTextLayoutCreate() - Was redundant due to the underlaying Format already taking it into account - Saves about 8% of CPU time in __DWriteTextLayoutCreate() - reserve() ahead of time for glyphRunDescriptionInfo._clusterMap, CTRun->_glyphOrigins, ->_glyphAdvances - Was previously about 8~10% of _DWriteCreateFrame()'s CPU time, now negligible - Remove DWriteWrapper _GetUserDefaultLocaleName(), don't wrap in a wstring, directly use a wchar_t buffer - Performance impact not measured, likely to be fairly small - Reduce the number of character buffer copies in _CFStringFromLocalizedString() by 1 - Saves 20%~30% of CPU time in _CFStringFromLocalizedString() - Remove unused/not useful _characters member from CTTypesetter - Misc Related to #1374
- Loading branch information
Showing
8 changed files
with
95 additions
and
86 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
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
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
Oops, something went wrong.