Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
P
poppler
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 540
    • Issues 540
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 22
    • Merge Requests 22
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Registry
    • Registry
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • poppler
  • poppler
  • Merge Requests
  • !121

Open
Opened Nov 21, 2018 by Adam Reichold@adamreichold
  • Report abuse
Report abuse

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 
Title:          EU Coalition Explorer
Subject:        Data of the EU28 Survey on Coalition Building in the European Union
Keywords:       EU Coalition Explorer; EU28 Survey; Rethink Europe; ECFR; ECFR Berlin; European Council on Foreign Relations; Josef Janning; Christoph Klavehn; Almut Möller; Wiebke Ewering; Denkbuilder; Dieter Dollacker; Dirk Waldik
Author:         ECFR European Council on Foreign Relations
Creator:        Adobe Illustrator CS6 (Windows)
Producer:       Adobe PDF library 10.01
CreationDate:   Mon Oct 29 19:37:25 2018 CET
ModDate:        Mon Nov 12 21:39:00 2018 CET
Tagged:         no
UserProperties: no
Suspects:       no
Form:           AcroForm
Syntax Warning: Bad annotation destination
JavaScript:     no
Pages:          1113
Encrypted:      no
Page size:      1920 x 1166 pts
Page rot:       0
File size:      75609160 bytes
Optimized:      no
PDF version:    1.7

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 
Title:          EU Coalition Explorer
Subject:        Data of the EU28 Survey on Coalition Building in the European Union
Keywords:       EU Coalition Explorer; EU28 Survey; Rethink Europe; ECFR; ECFR Berlin; European Council on Foreign Relations; Josef Janning; Christoph Klavehn; Almut Möller; Wiebke Ewering; Denkbuilder; Dieter Dollacker; Dirk Waldik
Author:         ECFR European Council on Foreign Relations
Creator:        Adobe Illustrator CS6 (Windows)
Producer:       Adobe PDF library 10.01
CreationDate:   Mon Oct 29 19:37:25 2018 CET
ModDate:        Mon Nov 12 21:39:00 2018 CET
Tagged:         no
UserProperties: no
Suspects:       no
Form:           AcroForm
Syntax Warning: Bad annotation destination
JavaScript:     no
Pages:          1113
Encrypted:      no
Page size:      1920 x 1166 pts
Page rot:       0
File size:      75609160 bytes
Optimized:      no
PDF version:    1.7

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

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch https://gitlab.freedesktop.org/adamreichold/poppler.git memoize-fetch
git checkout -b adamreichold/poppler-memoize-fetch FETCH_HEAD

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/master
git merge --no-ff adamreichold/poppler-memoize-fetch

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 7
  • Commits 4
  • Pipelines 6
  • Changes 16
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: poppler/poppler!121