Closed Bug 1140945 Opened 9 years ago Closed 6 years ago

ProcessDisplayItems spends about 15ms in Homescreen edit mode when moving an item to change the scrollTop

Categories

(Firefox OS Graveyard :: Performance, defect, P3)

ARM
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: ethlin, Unassigned)

References

Details

Attachments

(5 files, 1 obsolete file)

When dragging an item in edit mode, I found that the FPS is 30fps and the most time consuming part is ProcessDisplayItems. There are too many items in the Homescreen, so we need to process about 70 items in the ProcessDisplayItems.
Attached file Profile result (obsolete) —
Attached file Profile result
After bug 913443, the profiler is as attached file. The result is similar. The difference is just the large part becomes PopPaintedLayerData from ProcessDisplayItems.
Is there any possible way to improve the PopPaintedLayerData performance when there are a lot of items? Do you think multi-thread for AddPaintedDisplayItem is a good idea?
Attachment #8574484 - Attachment is obsolete: true
Flags: needinfo?(mstange)
(In reply to Ethan Lin[:Ethan] from comment #2)
> Is there any possible way to improve the PopPaintedLayerData performance
> when there are a lot of items?

One fairly simple optimization I can see is to avoid doing duplicate work in the loop that iterates over mAssignedDisplayItems. We could pull the loop into InvalidateForLayerChange and into AddPaintedDisplayItem (making two separate loops out of it). Then we could at least call this only once:

  PaintedDisplayItemLayerUserData* paintedData =
    static_cast<PaintedDisplayItemLayerUserData*>
      (layer->GetUserData(&gPaintedDisplayItemLayerUserData));

instead of for each item. And maybe other caching opportunities would become apparent.

> Do you think multi-thread for
> AddPaintedDisplayItem is a good idea?

I expect it won't be easy to separate the shared state mutating parts from the non-mutating parts of the code. Let's not think about this until we've exhausted the single threaded optimization opportunities.
Flags: needinfo?(mstange)
By the way, it looks like bug 913443 caused a real performance regression, see bug 1141247. Once I have profiles of the regression, I might have more ideas for optimization opportunities.
Blocks: gfxperf
Ethan, can you test whether these patches make a noticeable difference? They didn't help on bug 1141247.
Flags: needinfo?(etlin)
Markus, thanks for your patches. I tried your patches and the performance has no difference in my case. For now I am also studying the performance issue around here. I will let you know If I have any discovery.
Flags: needinfo?(etlin)
Thanks for testing.
Priority: -- → P3
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: