Closed
Bug 1007897
Opened 11 years ago
Closed 11 years ago
PDF.js spend 20-30% of time in SourceSurfaceCGBitmapContext::DrawTargetWillChange()
Categories
(Core :: Graphics: Layers, defect)
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: BenWa, Assigned: BenWa)
References
Details
(Whiteboard: [MemShrink][pdfjs-c-performance])
Attachments
(1 file)
730 bytes,
patch
|
BenWa
:
review+
|
Details | Diff | Splinter Review |
Looks like we're accidentally holding a snapshot to the canvas.
Assignee | ||
Comment 1•11 years ago
|
||
mattwoodrow: BenWa: http://mxr.mozilla.org/mozilla-central/source/gfx/layers/CopyableCanvasLayer.cpp#92
mattwoodrow: should set mSurface to nullptr after that CopySurface call
Assignee | ||
Comment 2•11 years ago
|
||
With this patch it's down to 3%
Assignee | ||
Comment 3•11 years ago
|
||
Updated•11 years ago
|
Whiteboard: [MemShrink]
Comment 4•11 years ago
|
||
20--30% of what? I'm confused; the title sounds like this is a performance (speed) bug, but the patch looks like a MemShrink bug. Does freeing the memory also speed things up? Thanks.
Comment 5•11 years ago
|
||
There's a little more context on the Hacker News discussion that spawned this bug:
https://news.ycombinator.com/item?id=7717191
"20% of the time is spent copying the canvas because someone is, likely erroneously, holding a reference to the canvas."
It just sounded to me like it had to be a memory win, too. ;)
Assignee | ||
Comment 6•11 years ago
|
||
Sorry, I meant time. The problem is we hold a reference to an image longer then we need. When we go to touch the copy we see that someone is still referencing a snapshot of that image so we have to copy that image. The image will get deleted soon after but we still make a needless copy.
This will reduce peak memory but wont really decrease average memory usage.
Summary: PDF.js spend 20-30% in SourceSurfaceCGBitmapContext::DrawTargetWillChange() → PDF.js spend 20-30% of time in SourceSurfaceCGBitmapContext::DrawTargetWillChange()
Comment 7•11 years ago
|
||
> This will reduce peak memory but wont really decrease average memory usage.
Good! Given a choice, I prefer reducing peak than average.
Comment 8•11 years ago
|
||
Yeah, peak memory usage is a big problem on the phones, it can often spike quite high, and is hard to measure (and thus hard to fix).
Updated•11 years ago
|
Whiteboard: [MemShrink] → [MemShrink][pdfjs-c-performance]
Assignee | ||
Comment 9•11 years ago
|
||
Assignee | ||
Comment 10•11 years ago
|
||
Unsurprisingly:
Improvement: Mozilla-Inbound - CanvasMark - MacOSX 10.6 (rev4) - 6.1% increase
Comment 11•11 years ago
|
||
Could the "<Regression> Mozilla-Inbound - CanvasMark - Android 2.2 (Native) - 9.12%" be from this?
Assignee | ||
Comment 12•11 years ago
|
||
It's hard to convince how releasing an image (and a snapshot flag) earlier could cause a regression. But it's the most likely in the regression window.
Comment 13•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in
before you can comment on or make changes to this bug.
Description
•