Files
ladybird/Libraries/LibGfx
Andreas Kling bfead0cb20 LibGfx: Cache ASCII font resolution in FontCascadeList
font_for_code_point() was the heaviest function in layout profiles
of a YouTube page (216ms CPU out of 2900ms total). Every call walked
the full cascade and ran a virtual contains_glyph() against each
entry, even though the result is the same for most ASCII code points
across a document.

Add a 128-entry direct-mapped cache keyed by code point that stores
the resolved Font pointer on first lookup. Subsequent ASCII lookups
become a null check plus a load.

No invalidation is needed: m_fonts is append-only, and the cascade
returns the first matching font, so once an entry claims a code
point, later appends cannot change the answer.
2026-04-24 12:54:11 +02:00
..
2024-12-28 05:39:32 -08:00
2024-11-20 21:13:23 +01:00
2026-04-20 15:45:58 -06:00
2025-06-09 11:25:14 -04:00