New issue
Advanced search Search tips

Issue 606684 link

Starred by 4 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocked on:
issue 613649



Sign in to add a comment

Investigate performance problems for 'HTML suite > DOM particles, SVG masks' benchmark

Project Member Reported by dk...@chromium.org, Apr 26 2016

Issue description

All benchmarks are under pr.gg/animometer/developer.html

- Set "Ramp" mode for benchmarking.
- Set "Keep at a fixed complexity" for profiling.  Set an appropriate [high] complexity next to each test's name.

File any performance bugs found as blocking this issue.
 

Comment 1 by dk...@chromium.org, Apr 27 2016

Owner: vollick@chromium.org
Status: Assigned (was: Untriaged)
Unless I've measured incorrectly (and there's a good chance), the main thread costs are approximately:

~40% update layers
 - Almost entirely deciding if we're solid color (~38.8%).
 - We do this determination by replaying *everything* into a skia::analysiscanvas.

30% RenderWidgetCompositor::UpdateLayers()
 - this is the document lifecycle costs
   - 20.2% paint
   - 6.1% style/layout
   - 2.4% paint invalidation

4.3% v8
Linke to the code that does the solid color analysis: https://code.google.com/p/chromium/codesearch#chromium/src/cc/playback/recording_source.cc&l=232
Cc: chrishtr@chromium.org vmp...@chromium.org jbroman@chromium.org
Vlad, should the solid color analysis early out? Can we update the value cheaply somehow?
Cc: wangxianzhu@chromium.org
https://bugs.chromium.org/p/chromium/issues/detail?id=611924 seems possibly relevant. You might want to check if that patch helps with the AnalysisCanvas time here.

Comment 6 by vmp...@chromium.org, May 16 2016

@5, That is indeed relevant.

The solid color analysis when it comes to layers relies on the op count. Specifically, it only analyzes layers if the op count is 10 or less. If this value is reported incorrectly, then we'll end up playing back the whole raster source worth of information to the analysis canvas, which can be slow.

Comment 7 by dk...@chromium.org, May 18 2016

What do the numbers look like when the patch referenced in #5 is applied?

Comment 8 by rbyers@chromium.org, May 20 2016

I looked at this benchmark on ChromeOS 51.0.2704.42 (trace attached).  One thing that seems worth investigating is that each FrameView::synchronizePaint triggers a LOT of calls to FrameView::layout (219 in the most expensive portion of the benchmark).
trace_anim-dompart-trace.json.gz
3.3 MB Download
Screenshot 2016-05-20 at 2.21.01 PM.png
37.8 KB View Download
Blockedon: 613649
Owner: chrishtr@chromium.org
Layout within paint??? That isn't right. It should be impossible. I'll look.
Things look better after #5. (yay).

The breakdown I'm currently seeing is as follows:
* 65% main thread
  * 47% document work
    * 33% sync paint
    * 9.2% style/layout
    * 3.7% paint invalidation
    * 0.1% compositing update
  * 12.5% js
* 22.9 raster workers (split between 4 of them).
* 8.1% compositor thread
* 2.5% io thread

The compositor thread cost was surprising given that there's not much happening from a compositor pov. However, nothing jumped out as a clear culprit. Lots of calls, each not too awful individually, but expensive in aggregate.
Cc: f...@opera.com pdr@chromium.org
Components: Blink>SVG
It looks like every time we paint an SVG image, we check to see if we need to update style/layout.  SVGImage::drawInternal calls FrameView::updateAllLifecyclePhasesExceptPaint and this account for 9% of the total CPU time spent in the benchmark in my test.  Ideally we shouldn't be doing that here (isn't it a violation of the document lifecycle?).  pdr/fs - any idea if that's really necessary and if so why?
Blockedon: 613662
Owner: vollick@chromium.org
We're looking at a bunch of different things in this bechmark.  Filed issue 613362 to track this specific "SVG painting spends a lot of time doing layout" issue and assigned it to you Chris - thanks!

Comment 15 by f...@opera.com, May 20 2016

The reason FrameView::updateAllLifecyclePhasesExceptPaint is called where it is, is because of the FrameView::resize (and FrameView::processUrlFragment) call(s) at the beginning of the function. In turn the reason for that is the context-sensitivity of SVG image - depending on the embedding context sizes (and other things - c.f processUrlFragment) can change.

I guess the interesting bit here is if this is a no-op or not. (9% sounds like an expensive no-op...)
Let's discuss on 613662.
Blockedon: -613662
Owner: vmi...@chromium.org

Comment 19 by f...@opera.com, Nov 28 2016

Labels: -Pri-1 Pri-2
Owner: ----
Status: Available (was: Assigned)

Sign in to add a comment