Does PDFium memory cache any file resources like fonts and images etc?

41 views
Skip to first unread message

南风不竞

unread,
May 20, 2024, 4:17:18 AMMay 20
to pdfium
Recently I was working on benchmarks between MuPDF and PDFium. In most scenario, PDFium is slower than MuPDF whether skia is enabled or not. 

MuPDF does cache fonts, images and other resources internally in a global context, so they can avoid reloading resources each time they are required.  

So I was wondering whether PDFium has cache mechanism like above. If not, maybe this could help on either parsing or rendering document. If PDFium does cache resources, what would be the bottlenecks on rendering or parsing.

Lei Zhang

unread,
May 20, 2024, 12:25:34 PMMay 20
to 南风不竞, pdfium
Yes, PDFium does do caching internally. For instance,
https://pdfium-review.googlesource.com/116891 made many PDFs that
contain ICC data render a lot faster.

There are already several issues on the PDFium issue tracker where
PDFium renders significantly slower compared to other libraries. If
you see issues, please file reports.
> --
> You received this message because you are subscribed to the Google Groups "pdfium" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/92251c99-0148-44a5-bc10-e4fd5c28cc91n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages