Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Issue 2470803003: Traverse PDF page tree only once in CPDF_Document Try 3 (Closed)

Created:
4 years, 1 month ago by npm
Modified:
4 years, 1 month ago
CC:
pdfium-reviews_googlegroups.com
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

Traverse PDF page tree only once in CPDF_Document Try 3 Now, we do not start traversal from where we were at, but from the top. This makes the code less prone to bugs, as now there is no need to call methods to recursively fix things. This will save a lot of time when the trees are rather flat, as in the PDF file in the bug. It can still be slow, for instance if we have a chain of page nodes, and the last in the chain contains all of the pages (this is artificial). Try 2 at https://codereview.chromium.org/2442403002/ Also added test where Try 2 would have failed. Tested the pdf from the bug on my Mac: With this CL: load in 21 seconds Without this CL: did not load in 4 minutes, got tired of waiting BUG=chromium:638513 Committed: https://pdfium.googlesource.com/pdfium/+/ec64cee9acccd0d1e574bbbd8aa91b08c1cf254f

Patch Set 1 #

Patch Set 2 : Rebase and test #

Total comments: 8

Patch Set 3 : Rebase, nits #

Total comments: 17

Patch Set 4 : Comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -32 lines) Patch
M core/fpdfapi/parser/cpdf_document.h View 1 2 3 2 chunks +10 lines, -4 lines 0 comments Download
M core/fpdfapi/parser/cpdf_document.cpp View 1 2 3 5 chunks +62 lines, -26 lines 0 comments Download
M core/fpdfapi/parser/cpdf_document_unittest.cpp View 1 2 3 2 chunks +25 lines, -2 lines 0 comments Download

Messages

Total messages: 30 (21 generated)
npm
PTAL. Third time the charm? ...
4 years, 1 month ago (2016-11-02 01:02:22 UTC) #9
Tom Sepez
I'm still having a hard time getting my tiny brain around all of this and ...
4 years, 1 month ago (2016-11-02 17:37:38 UTC) #12
npm
I'm sorry that the code is hard to understand, although I do think that this ...
4 years, 1 month ago (2016-11-03 00:18:25 UTC) #13
Tom Sepez
I think this works, LGTM, but see if Lei has any issues. https://codereview.chromium.org/2470803003/diff/40001/core/fpdfapi/parser/cpdf_document.cpp File core/fpdfapi/parser/cpdf_document.cpp ...
4 years, 1 month ago (2016-11-03 22:31:00 UTC) #18
npm
https://codereview.chromium.org/2470803003/diff/40001/core/fpdfapi/parser/cpdf_document.cpp File core/fpdfapi/parser/cpdf_document.cpp (right): https://codereview.chromium.org/2470803003/diff/40001/core/fpdfapi/parser/cpdf_document.cpp#newcode457 core/fpdfapi/parser/cpdf_document.cpp:457: if (static_cast<int>(m_pTreeTraversal.size()) != level + 1 || Just noticed ...
4 years, 1 month ago (2016-11-03 22:37:57 UTC) #19
Lei Zhang
https://codereview.chromium.org/2470803003/diff/40001/core/fpdfapi/parser/cpdf_document.cpp File core/fpdfapi/parser/cpdf_document.cpp (right): https://codereview.chromium.org/2470803003/diff/40001/core/fpdfapi/parser/cpdf_document.cpp#newcode404 core/fpdfapi/parser/cpdf_document.cpp:404: // When this is called, m_pTreeTraversal[level] exists Move documentation ...
4 years, 1 month ago (2016-11-04 01:38:52 UTC) #20
npm
https://codereview.chromium.org/2470803003/diff/40001/core/fpdfapi/parser/cpdf_document.cpp File core/fpdfapi/parser/cpdf_document.cpp (right): https://codereview.chromium.org/2470803003/diff/40001/core/fpdfapi/parser/cpdf_document.cpp#newcode404 core/fpdfapi/parser/cpdf_document.cpp:404: // When this is called, m_pTreeTraversal[level] exists On 2016/11/04 ...
4 years, 1 month ago (2016-11-04 19:33:34 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2470803003/60001
4 years, 1 month ago (2016-11-04 19:54:38 UTC) #28
commit-bot: I haz the power
4 years, 1 month ago (2016-11-04 19:54:54 UTC) #30
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://pdfium.googlesource.com/pdfium/+/ec64cee9acccd0d1e574bbbd8aa91b08c1cf...

Powered by Google App Engine
This is Rietveld 408576698