serenity/Userland
Nico Weber c8510b58a3 LibPDF: Cache fonts per page
Previously, every time a page switched fonts, we'd completely
re-parse the font.

Now, we cache fonts in Renderer, effectively caching them per page.

It'd be nice to have an LRU cache across pages too, but that's a
bigger change, and this already helps a lot.

Font size is part of the cache key, which means we re-parse the same
font at different font sizes. That could be better too, but again,
it's a big help as-is already.

Takes rendering the 1310 pages of the PDF 1.7 reference with

    Build/lagom/bin/pdf --debugging-stats \
        ~/Downloads/pdf_reference_1-7.pdf

from 71 s to 11s :^)

Going through pages especially in the index is noticeably snappier.

(On the PDF 2.0 spec, ISO_32000-2-2020_sponsored.pdf, it's less
dramatic: From 19s to 16s.)
2023-10-11 07:10:19 +02:00
..
Applets Userland: Port remaining calls to Widget::set_tooltip_deprecated() 2023-10-06 08:20:11 +02:00
Applications LibGfx: Expose BitmapFont glyph data as Spans instead of raw pointers 2023-10-10 14:36:25 +02:00
BuggieBox checksum: Add support for BLAKE2b 2023-09-17 16:49:35 +03:30
Demos Userland: Use non-fallible EventReceiver::add() where possible 2023-09-25 10:58:31 +02:00
DevTools Userland: Port remaining calls to Widget::set_tooltip_deprecated() 2023-10-06 08:20:11 +02:00
DynamicLoader CMake: Use CMAKE_POSITION_INDEPENDENT_CODE instead of explicit -fpic 2023-09-18 10:26:42 +02:00
Games GameOfLife: Allow pressing escape to clear the selected pattern 2023-10-07 11:36:57 +02:00
Libraries LibPDF: Cache fonts per page 2023-10-11 07:10:19 +02:00
Services LibWeb: Port AttributeNames to FlyString 2023-10-08 08:11:48 -04:00
Shell Shell: Add support for the bashy list literals in POSIX mode 2023-10-07 22:16:35 +03:30
Utilities find: Don't canonicalize path operands 2023-10-07 11:37:53 +02:00
CMakeLists.txt