The source project of this merge request has been removed.
RFC: Memoize fetch
This adds a small (3 instances) object cache to memoize XRef::fetch
using PopplerCache
which helps a lot of if we repeatedly parse large Objects, e.g. the document from #673 on the current master
yields before:
poppler-release-build> time ./utils/pdfinfo ~/Downloads/ECFR269_EU_COALITION_EXPLORER_2018_V1.10.pdf
[...]
real 8m15,392s
user 7m45,789s
sys 0m26,866s
and after this change:
poppler-release-build> time ./utils/pdfinfo ~/Downloads/ECFR269_EU_COALITION_EXPLORER_2018_V1.10.pdf
[...]
real 0m49,825s
user 0m48,172s
sys 0m1,282s
To do the memoization without side effects, we have to deep copy those objects to avoid modifying shared instances, e.g. objArray
or objDict
instances.
Closes #673