diff options
author | npm <npm@chromium.org> | 2016-10-26 11:03:43 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-26 11:03:43 -0700 |
commit | d3a2009d75eac3cda442f545ef0865afae7b35cf (patch) | |
tree | 9bbc5bbfbd48e1e63acd1bf55cac09d65cef8882 /testing | |
parent | 1842be87408b06bf0b4c521044c09452caac5c80 (diff) | |
download | pdfium-d3a2009d75eac3cda442f545ef0865afae7b35cf.tar.xz |
Traverse PDF page tree only once in CPDF_Document
Try 2: main fix was recursively popping elements from the stack. Since
the Traverse method can be called on non-root nodes from GetPage(), we
have to make sure to properly update the parents.
Try 1 at https://codereview.chromium.org/2414423002/
In our current implementation of CPDF_Document::GetPage, we traverse
the PDF page tree until we find the index we are looking for. This is
slow when we do calls GetPage(0), GetPage(1), ... since in this case
the page tree will be traversed n times if there are n pages. This CL
makes sure the page tree is only traversed once.
Time to load the PDF from the bug below in chrome official build:
Before this CL: around 1 minute 25 seconds
After this CL: around 4 seconds
BUG=chromium:638513
Review-Url: https://codereview.chromium.org/2442403002
Diffstat (limited to 'testing')
0 files changed, 0 insertions, 0 deletions