-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(troika-3d-text): major speed/memory improvement in text layout
This gives a big performance bump when laying out very large blocks of text. It is mostly achieved by collecting glyph data in flattened arrays rather than an object per glyph. It also eliminates an intermediate array holding all renderable glyphs, and calculates anchor offsets earlier to avoid an extra loop. Some rough benchmarks on my 2015 MBP: 100K characters: - Before: ~230ms, max 32MB heap - After: ~160ms, max 26MB heap 1 million characters: - Before: ~1600ms, max 220MB heap - After: ~950ms, max 145MB heap
- Loading branch information
Showing
1 changed file
with
146 additions
and
113 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