nsCSSRendering::PaintBackground takes too long

NEW
Unassigned

Status

()

defect
8 years ago
7 years ago

People

(Reporter: jrmuizel, Unassigned)

Tracking

(Depends on 1 bug, Blocks 1 bug)

unspecified
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(blocking-fennec1.0 -)

Details

We spend a large chunk (46%) of our painting time on CNN drawing backgrounds. We should try to do something cheaper
Blocks: 729391
blocking-fennec1.0: --- → ?
Assignee: nobody → ajuma
Waiting for Ali to get back to us with details before making a blocking decision.
Whiteboard: [waiting-for-details]
Summary: nsCSSBackground::PaintBackground takes too long → nsCSSRendering::PaintBackground takes too long
While loading CNN on a Galaxy Nexus, we spend around 700 ms in nsCSSRendering::PaintBackground. Most individual calls are fast (the average call takes about 0.4 ms), but we make a *lot* of calls (around 1700), and a handful of these calls (around 10) do take a significant amount of time (between 10 and 25 ms).

Of the time we spend in nsCSSRendering::PaintBackground, about 67% is in gfxUtils::DrawPixelSnapped.

And of the time we spend in gfxUtils::DrawPixelSnapped, about 30% is in CreateSamplingRestrictedDrawable (however, on other pages, this is 10-15%), and the rest is in the call to gfxDrawable::Draw.
Depends on: 733941
(In reply to Ali Juma [:ajuma] from comment #2)
> While loading CNN on a Galaxy Nexus, we spend around 700 ms in
> nsCSSRendering::PaintBackground. Most individual calls are fast (the average
> call takes about 0.4 ms), but we make a *lot* of calls (around 1700), and a
> handful of these calls (around 10) do take a significant amount of time
> (between 10 and 25 ms).
> 
> Of the time we spend in nsCSSRendering::PaintBackground, about 67% is in
> gfxUtils::DrawPixelSnapped.
> 
> And of the time we spend in gfxUtils::DrawPixelSnapped, about 30% is in
> CreateSamplingRestrictedDrawable (however, on other pages, this is 10-15%),
> and the rest is in the call to gfxDrawable::Draw.

The question we need to answer is: is the work we're doing necessary and why. i.e. do the times we see match what we would expect them to be.
What are the costs on planet.mozilla.org and nytimes.com?
(In reply to JP Rosevear [:jpr] from comment #4)
> What are the costs on planet.mozilla.org and nytimes.com?

On planet.mozilla.org, we spend around 185 ms in PaintBackground. The average call takes about 1.85 ms, but as on cnn.com, there are a handful of calls that take a significant amount of time (between 10 and 35 ms). Of the time we spend in PaintBackground, about 85% is in DrawPixelSnapped. And of the time we spend in DrawPixelSnapped, about 30% is in CreateSamplingRestrictedDrawable.

On nytimes.com, we spend around 245 ms in PaintBackground. The average call takes about 0.5 ms, and no call takes more than 2.5 ms. Of the time we spend in PaintBackground, about 75% is in DrawPixelSnapped. And of the time we spend in DrawPixelSnapped, about 20% is in CreateSamplingRestrictedDrawable.
If we have any more specific bugs besides bug 733941, please nom those individually.
blocking-fennec1.0: ? → -
Depends on: 747507
Whiteboard: [waiting-for-details]
Assignee: ajuma.bugzilla → nobody
You need to log in before you can comment on or make changes to this bug.