This commit restructures the font cache within the HarfbuzzShaper type to function as an LRU cache with a configurable size, and it also updates the shaping benchmark to measure the performance impact of the cache. For small bodies of text, initial benchmark results suggest substantial performance improvements for complex scripts (and complex fonts) and marginal gains for simpler scripts like latin.
I'm going to go ahead and rebase+merge this with your approval, as that will add these changes to your existing PR. Then we can await @andydotxyz's feedback there.
This commit restructures the font cache within the HarfbuzzShaper type to function as an LRU cache with a configurable size, and it also updates the shaping benchmark to measure the performance impact of the cache. For small bodies of text, initial benchmark results suggest substantial performance improvements for complex scripts (and complex fonts) and marginal gains for simpler scripts like latin.