New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 606678 link

Starred by 4 users

Issue metadata

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



Sign in to add a comment

Investigate performance problems for 'Animometer score > Canvas arcs' 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 vmi...@chromium.org, Apr 27 2016

Labels: OS-All
Owner: junov@chromium.org
Status: Assigned (was: Untriaged)
It looks like we're doing all the rasterization on the Main Thread.  We could possibly see an improvement with display-list-canvas drawing on the Impl side.  --force-display-list-2d-canvas isn't making a difference.
trace_animometer-canvas-arcs.json.gz
769 KB Download

Comment 2 by junov@chromium.org, Apr 27 2016

Even with the deferred rendering of the GPU-accelerated path, I am seeing most of the run-time being spent in V8 execution.  It looks like draw call overhead (including SkPicture recording) may be the main bottleneck for many of the canvas sub-benchmarks. I did not expect this. I was expecting more cases to be GPU bound or CPU bound in skia.  Must figure out what's up with that.

Comment 3 by junov@chromium.org, Apr 27 2016

Cc: bsalomon@chromium.org
It appears that the arc paths use a fallback code path that renders the path on the CPU then uploads each individual path as a texture.  This CPU to GPU overhead is what is killing performance.  There are two obvious solutions:
1. Improve the GPU path rasterizer so that it can handle this case. (bsalomon?)
2. Make the canvas fallback to software rasterization when this use case is detected. I found that turning disabling accelerated 2D canvas more than triples the performance of this benchmark.

In the short term, I think 2. is the most realistic.
@bsalomon: Can you give some guidance on which cases of path rendering rusult in SW draw -> tex upload.  Is there an easy way to query this?

Comment 4 by bsalo...@google.com, Apr 27 2016

Are the paths just partial circular arcs?

Comment 5 by junov@chromium.org, Apr 27 2016

Yeah, stroked

Comment 6 by vmi...@chromium.org, Apr 27 2016

Ahh, so IIUC from #2 we're not usually Skia playback/GPU bound, but from #3 on the Canvas arcs test we are?

Comment 7 by junov@chromium.org, Apr 27 2016

@#6: Correct.

Comment 8 by bsalo...@google.com, Apr 27 2016

what type of caps? We can probably add a fast path for this.

Is there any hope of auto-selecting MSAA for canvas like we do for raster?

Comment 9 by junov@chromium.org, Apr 27 2016

So i tried running with --canvas-msaa-sample-count=4.  The rendering all happens on the GPU when I do that (Yay!), but I only saw a 10% boost in performance (Boo). Rendering becomes completely GPU-bound. It is still way faster to render on the CPU.

This is on a stock z620 Windows machine.
Cc: junov@chromium.org ikilpatrick@chromium.org
 Issue 606679  has been merged into this issue.
junov: is the draw call overhead similar to what I mentioned in issue 606685?
@#11: No this one is substantially different. It's a case where GPU is slower than CPU rendering.

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

Do we know why GPU is slower than CPU in this case, or are we still looking into that?

Comment 14 by junov@chromium.org, May 18 2016

It is because we have no rendering algorithm for drawing anti-aliased concave paths on the GPU.  So the GPU code path ends up creating a temporary software canvas for drawing the arc, uploads the result to a GPU texture, and composites it onto the GPU canvas.

Comment 15 by junov@chromium.org, May 18 2016

Owner: sebastienlc@google.com
Labels: Hotlist-Recharge-BouncingOwner
Owner: ----
Status: Untriaged (was: Assigned)
This owner is not able to receive e-mails, please re-triage.
Components: Blink>Canvas
Status: Available (was: Untriaged)
Labels: -Pri-1 -Hotlist-Recharge-BouncingOwner Pri-2
Owner: senorblanco@chromium.org
Status: Assigned (was: Available)
senorblanco@, does your recent change for tesselating path renderer fix this case? Is it even fixable?
Sadly, no. The tessellator is a wash vs. the default path renderer on this test case.

I have some ideas about how to speed it up, but nothing guaranteed.
Cc: -junov@chromium.org

Sign in to add a comment