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

Issue 1380243004: Various changes to JBig2 cache: (Closed)

Created:
5 years, 2 months ago by David Lattimore
Modified:
5 years, 2 months ago
Reviewers:
Lei Zhang, jbreiden
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Various changes to JBig2 cache: - Makes the cache be per-document - Keys the cache on ObjNum and stream offset instead of keying on a pointer to the data (which can result in false cache hits). - Makes it so the cache is only used for the globals stream. - Reenable the cache. R=thestig@chromium.org BUG=pdfium:207 Committed: https://pdfium.googlesource.com/pdfium/+/f1b88e76134808f36f16b9e53a2e9dd89b12c8fd

Patch Set 1 #

Total comments: 31

Patch Set 2 : Addressed review comments #

Patch Set 3 : Rebase (with some manual merges) #

Patch Set 4 : Rebase #

Total comments: 11

Patch Set 5 : Addressed review comments #

Patch Set 6 : Addressed review comment that I missed #

Total comments: 2

Patch Set 7 : Addressed comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+124 lines, -90 lines) Patch
M core/include/fxcodec/fx_codec.h View 1 2 3 4 2 chunks +5 lines, -4 lines 0 comments Download
M core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp View 1 chunk +4 lines, -6 lines 0 comments Download
M core/src/fxcodec/codec/codec_int.h View 1 2 3 2 chunks +5 lines, -11 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec_jbig.cpp View 1 2 3 2 chunks +39 lines, -12 lines 0 comments Download
M core/src/fxcodec/jbig2/JBig2_BitStream.h View 1 2 3 4 3 chunks +5 lines, -1 line 0 comments Download
M core/src/fxcodec/jbig2/JBig2_BitStream.cpp View 1 2 3 4 5 2 chunks +12 lines, -2 lines 0 comments Download
M core/src/fxcodec/jbig2/JBig2_Context.h View 1 2 5 chunks +12 lines, -10 lines 0 comments Download
M core/src/fxcodec/jbig2/JBig2_Context.cpp View 1 2 3 4 5 6 5 chunks +38 lines, -42 lines 0 comments Download
M core/src/fxcodec/jbig2/JBig2_Segment.h View 1 chunk +2 lines, -1 line 0 comments Download
M core/src/fxcodec/jbig2/JBig2_Segment.cpp View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 26 (1 generated)
David Lattimore
5 years, 2 months ago (2015-10-06 02:27:04 UTC) #1
David Lattimore
I ran with and without this change and checked the number of cache hits on ...
5 years, 2 months ago (2015-10-06 02:30:45 UTC) #2
jbreiden
This sounds a little suspicious, because the 'Digitized by Google' watermark is also JBIG2 but ...
5 years, 2 months ago (2015-10-06 03:30:58 UTC) #3
David Lattimore
I see 332 calls to CJBig2_Context::parseSymbolDict() regardless of whether the cache is enabled (both without ...
5 years, 2 months ago (2015-10-06 05:20:09 UTC) #4
jbreiden
Yes, my mistake. I just want to positively confirm that we aren't making lots of ...
5 years, 2 months ago (2015-10-06 21:58:29 UTC) #5
Lei Zhang
I'll leave it to you and Jeff to figure out if the cache is effective. ...
5 years, 2 months ago (2015-10-06 22:40:24 UTC) #6
jbreiden
https://codereview.chromium.org/1380243004/diff/1/core/src/fxcodec/jbig2/JBig2_Context.cpp File core/src/fxcodec/jbig2/JBig2_Context.cpp (right): https://codereview.chromium.org/1380243004/diff/1/core/src/fxcodec/jbig2/JBig2_Context.cpp#newcode21 core/src/fxcodec/jbig2/JBig2_Context.cpp:21: // again. We key off of the memory location ...
5 years, 2 months ago (2015-10-07 17:50:17 UTC) #8
Lei Zhang
https://codereview.chromium.org/1380243004/diff/1/core/src/fxcodec/jbig2/JBig2_Context.cpp File core/src/fxcodec/jbig2/JBig2_Context.cpp (right): https://codereview.chromium.org/1380243004/diff/1/core/src/fxcodec/jbig2/JBig2_Context.cpp#newcode28 core/src/fxcodec/jbig2/JBig2_Context.cpp:28: #ifndef DISABLE_SYMBOL_CACHE On 2015/10/07 17:50:17, jbreiden wrote: > I'd ...
5 years, 2 months ago (2015-10-07 17:59:24 UTC) #9
jbreiden
https://codereview.chromium.org/1380243004/diff/1/core/src/fxcodec/jbig2/JBig2_Context.cpp File core/src/fxcodec/jbig2/JBig2_Context.cpp (right): https://codereview.chromium.org/1380243004/diff/1/core/src/fxcodec/jbig2/JBig2_Context.cpp#newcode659 core/src/fxcodec/jbig2/JBig2_Context.cpp:659: #ifndef DISABLE_SYMBOL_CACHE Something seems wrong when a compiler pushes ...
5 years, 2 months ago (2015-10-07 19:22:51 UTC) #10
Lei Zhang
https://codereview.chromium.org/1380243004/diff/1/core/src/fxcodec/jbig2/JBig2_Context.cpp File core/src/fxcodec/jbig2/JBig2_Context.cpp (right): https://codereview.chromium.org/1380243004/diff/1/core/src/fxcodec/jbig2/JBig2_Context.cpp#newcode659 core/src/fxcodec/jbig2/JBig2_Context.cpp:659: #ifndef DISABLE_SYMBOL_CACHE On 2015/10/07 19:22:51, jbreiden wrote: > Something ...
5 years, 2 months ago (2015-10-07 19:31:59 UTC) #11
David Lattimore
https://codereview.chromium.org/1380243004/diff/1/core/src/fxcodec/codec/codec_int.h File core/src/fxcodec/codec/codec_int.h (left): https://codereview.chromium.org/1380243004/diff/1/core/src/fxcodec/codec/codec_int.h#oldcode283 core/src/fxcodec/codec/codec_int.h:283: FX_BOOL m_bFileReader; On 2015/10/06 22:40:23, Lei Zhang wrote: > ...
5 years, 2 months ago (2015-10-07 22:41:53 UTC) #12
Lei Zhang
Will look. Thanks for dealing with the merge conflicts.
5 years, 2 months ago (2015-10-08 03:07:53 UTC) #13
Lei Zhang
https://codereview.chromium.org/1380243004/diff/50001/core/include/fxcodec/fx_codec.h File core/include/fxcodec/fx_codec.h (right): https://codereview.chromium.org/1380243004/diff/50001/core/include/fxcodec/fx_codec.h#newcode13 core/include/fxcodec/fx_codec.h:13: #include "../fpdfapi/fpdf_objects.h" nit: forward declare CFX_PrivateData and CPDF_StreamAcc instead? ...
5 years, 2 months ago (2015-10-08 03:22:44 UTC) #14
Lei Zhang
I'm doing a Release build with Chromium's Clang as the compiler. For control.pdf and experiment.pdf, ...
5 years, 2 months ago (2015-10-08 03:44:39 UTC) #15
David Lattimore
https://codereview.chromium.org/1380243004/diff/50001/core/include/fxcodec/fx_codec.h File core/include/fxcodec/fx_codec.h (right): https://codereview.chromium.org/1380243004/diff/50001/core/include/fxcodec/fx_codec.h#newcode13 core/include/fxcodec/fx_codec.h:13: #include "../fpdfapi/fpdf_objects.h" On 2015/10/08 03:22:44, Lei Zhang wrote: > ...
5 years, 2 months ago (2015-10-08 03:44:39 UTC) #16
David Lattimore
On 2015/10/08 03:44:39, Lei Zhang wrote: > I'm doing a Release build with Chromium's Clang ...
5 years, 2 months ago (2015-10-08 03:55:07 UTC) #17
Lei Zhang
https://codereview.chromium.org/1380243004/diff/50001/core/src/fxcodec/jbig2/JBig2_BitStream.cpp File core/src/fxcodec/jbig2/JBig2_BitStream.cpp (right): https://codereview.chromium.org/1380243004/diff/50001/core/src/fxcodec/jbig2/JBig2_BitStream.cpp#newcode16 core/src/fxcodec/jbig2/JBig2_BitStream.cpp:16: m_dwObjNum(pSrcStream->GetStream()->GetObjNum()) { On 2015/10/08 03:44:39, David Lattimore wrote: > ...
5 years, 2 months ago (2015-10-08 03:56:05 UTC) #18
Lei Zhang
On 2015/10/08 03:55:07, David Lattimore wrote: > On 2015/10/08 03:44:39, Lei Zhang wrote: > > ...
5 years, 2 months ago (2015-10-08 04:03:22 UTC) #19
Lei Zhang
On 2015/10/08 04:03:22, Lei Zhang wrote: > On 2015/10/08 03:55:07, David Lattimore wrote: > > ...
5 years, 2 months ago (2015-10-08 04:12:51 UTC) #20
Lei Zhang
lgtm https://codereview.chromium.org/1380243004/diff/90001/core/src/fxcodec/jbig2/JBig2_Context.cpp File core/src/fxcodec/jbig2/JBig2_Context.cpp (right): https://codereview.chromium.org/1380243004/diff/90001/core/src/fxcodec/jbig2/JBig2_Context.cpp#newcode600 core/src/fxcodec/jbig2/JBig2_Context.cpp:600: if (m_bIsGlobal) { How about we add a ...
5 years, 2 months ago (2015-10-08 04:14:50 UTC) #21
Lei Zhang
Also, BUG=207
5 years, 2 months ago (2015-10-08 04:15:05 UTC) #22
Lei Zhang
On 2015/10/08 04:15:05, Lei Zhang wrote: > Also, BUG=207 Err, BUG=pdfium:207 is probably better.
5 years, 2 months ago (2015-10-08 04:15:24 UTC) #23
David Lattimore
https://codereview.chromium.org/1380243004/diff/90001/core/src/fxcodec/jbig2/JBig2_Context.cpp File core/src/fxcodec/jbig2/JBig2_Context.cpp (right): https://codereview.chromium.org/1380243004/diff/90001/core/src/fxcodec/jbig2/JBig2_Context.cpp#newcode600 core/src/fxcodec/jbig2/JBig2_Context.cpp:600: if (m_bIsGlobal) { On 2015/10/08 04:14:50, Lei Zhang wrote: ...
5 years, 2 months ago (2015-10-08 04:34:00 UTC) #24
Lei Zhang
++lgtm
5 years, 2 months ago (2015-10-08 04:40:55 UTC) #25
David Lattimore
5 years, 2 months ago (2015-10-08 21:18:35 UTC) #26
Message was sent while issue was closed.
Committed patchset #7 (id:110001) manually as
f1b88e76134808f36f16b9e53a2e9dd89b12c8fd (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698