crosswalk-project / crosswalk

A web runtime built on Chrome. This project is currently unmaintained.
https://crosswalk-project.org/blog/crosswalk-final-release.html
BSD 3-Clause "New" or "Revised" License
2.33k stars 651 forks source link

[PnP issue]The Canvas 2D KPIs have 20%~40% regression on crosswalk build 1.29.8.0 vs. 1.29.4.0 #806

Closed Chenqianx closed 10 years ago

Chenqianx commented 11 years ago

BUG DETAILED DESCRIPTIONS 3 Canvas 2D related KPIs have 20%~40% performance regression on Tizen crosswalk build 1.29.8.0 compared with build 1.29.4.0(152). The KPIs and Test Results are as below:

  1. http://www.craftymind.com/factory/guimark3/vector/GM3_JS_Vector.html build 1.29.8.0: 24.9 fps (performance dropped ~22%) build 1.29.4.0: 31.88 fps
  2. http://www.craftymind.com/factory/guimark3/bitmap/GM3_JS_Bitmap.html build 1.29.8.0: 21.18 fps (performance dropped ~44%) build 1.29.4.0: 37.64 fps
  3. http://www.craftymind.com/factory/guimark3/compute/GM3_JS_Compute.html build 1.29.8.0: 22.36 fps (performance dropped ~33%) build 1.29.4.0: 33.61 fps

Environment: Tizen2.1(0826.1): crosswalk build 1.29.8.0 PR3 device

EXACT STEPS LEADING TO PROBLEM: 1) xwalk --disable-web-security --allow-file-access-from-files http://www.craftymind.com/factory/guimark3/vector/GM3_JS_Vector.html 2) Tap on "Start Test" till the fps is stable 3) Record the FPS Other 2 benchmark URL: http://www.craftymind.com/factory/guimark3/bitmap/GM3_JS_Bitmap.html http://www.craftymind.com/factory/guimark3/compute/GM3_JS_Compute.html

EXPECTED OUTCOME: The performance gap between crosswalk build 1.29.8.0 and 1.29.4.0 should be <5%.

ACTUAL OUTCOME: The performance gap between crosswalk build 1.29.8.0 and 1.29.4.0 is >5%.

baleboy commented 11 years ago

Didn't you also change the Tizen platform version in this round? Does the same regression occur with the previous Tizen image?

xjiang45 commented 11 years ago

@baleboy , according to QA, this is a regression in crosswalk on both old and new Tizen images. Could we have @ds-hwang, the Tizen WebGL/Canvas2D KPI owner, have a look at this?

ds-hwang commented 11 years ago

@xjiang45 ok, I'll look at it.

ds-hwang commented 11 years ago

1.29.8.0 uses GPU Process, but 1.29.4.0 does not use GPU Process. It results in this performance regression.

GPU Process (mainly Accelerated Compositing) enhances performance of CSS Animations and scrolling. I think enabling GPU Process is better although it decreases Canvas performance. How do you think? @kenchris @darktears @shaochangbin @poussa @kalyankondapally @tiagovignatti Can we allow this canvas performance decrease?

The following patch added command_line->AppendSwitch(switches::kIgnoreGpuBlacklist) between 1.29.4.0 and 1.29.8.0, and then GPU Process has launched.

commit 9dcf2c864968bb6c95db8623e8690fa240978087
Author: He Xinchao <xinchao.he@intel.com>
Date:   Thu Sep 5 17:42:44 2013 +0800

    Support install application on Tizen

    When running in Tizen mobile OS, it'll call install_into_pkginfo_db.py to install package information into Tizen system database, create icon on home screen.

If you use --enable-software-compositing option to turn off GPU Process, Canvas performance is the same to 1.29.4.0.

The reason is that Accelerated Compositing causes additional texture upload. So 2d canvas performance is effected badly. Let me explain how we can see Canvas element

in 1.29.4.0. Render Process draws Canvas on Bitmap Render Process blits Canvas Bitmap onto page Bitmap Render Process sends page Bitmap to Browser Process. Browser Process blits page Bitmap onto Screen

in 1.29.8.0. (enabling GPU Process) Render Process draws Canvas on Bitmap. Render Process sends Canvas Bitmap to GPU Process. GPU Process upload Canvas Bitmap to Texture. <- it is expensive and occurs every frame. GPU Process blits Canvas Texture onto Screen.

ACCELERATED_2D_CANVAS I think accelerated 2d canvas will maybe satisfy us However, when I use --enable-accelerated-2d-canvas option, the performace is the same to 1.29.8.0. I don't know why yet. FYI, accelerated 2d canvas is by default in Android but is not by default in Linux desktop.

APPENDIX. in 1.29.4.0.

sh-4.1# ps -ef | grep xwalk                         
root      1259  1110 24 21:57 pts/0    00:00:02 /usr/lib/xwalk/xwalk --disable-web-security --allow-file-access-from-files http://www.craftymind.com/factory/guimark3/compute/GM3_JS_Compute.html
root      1260  1259  0 21:57 pts/0    00:00:00 /usr/lib/xwalk/xwalk --disable-web-security --allow-file-access-from-files http://www.craftymind.com/factory/guimark3/compute/GM3_JS_Compute.html
root      1261  1259  0 21:57 pts/0    00:00:00 /usr/lib/xwalk/xwalk --type=zygote --no-sandbox
root      1281  1261 62 21:57 pts/0    00:00:06 /usr/lib/xwalk/xwalk --type=zygote --no-sandbox

in 1.29.8.0. (enabling GPU Process)

sh-4.1# ps -ef | grep xwalk
root      1299  1110  7 21:58 pts/0    00:00:01 /usr/lib/xwalk/xwalk --disable-web-security --allow-file-access-from-files http://www.craftymind.com/factory/guimark3/compute/GM3_JS_Compute.html
root      1300  1299  0 21:58 pts/0    00:00:00 /usr/lib/xwalk/xwalk --disable-web-security --allow-file-access-from-files --disable-setuid-sandbox http://www.craftymind.com/factory/guimark3/compute/GM3_JS_Compute.html
root      1301  1299  0 21:58 pts/0    00:00:00 /usr/lib/xwalk/xwalk --type=zygote
root      1316  1299  0 21:58 pts/0    00:00:00 /usr/lib/xwalk/xwalk --type=xwalk-extension-process --channel=1299.0.417570706
root      1321  1301 52 21:58 pts/0    00:00:07 /usr/lib/xwalk/xwalk --type=renderer --enable-fixed-layout --enable-viewport --use-gl=egl --lang=en-US --channel=1299.1.1484447576
root      1325  1299 23 21:58 pts/0    00:00:03 /usr/lib/xwalk/xwalk --type=gpu-process --channel=1299.2.1459350798 --use-gl=egl --supports-dual-gpus=false --gpu-driver-
bug-workarounds=0,6,19 --gpu-vendor-id=0x8086 --gpu-device-id=0x0130 --gpu-driver-vendor --gpu-driver-version
kenchris commented 11 years ago

There is no way around us using accelerated compositing, threaded compositor etc. We NEED this.

On the other hand we need to find out how to avoid additional copies and this should be added to the graphics roadmap

@poussa

kalyankondapally commented 11 years ago

@ds-hwang Interesting.

Even though we save a copy by enabling GPU process, texture upload seems to cause a significant performance drop. I don't see any workaround for this till we have support for zero-copy cross process texture upload.

Is this performance drop specific to Tizen or can be seen on other environments i.e Linux desktop. Mesa did have some improvements on this front but that doesn't help with Tizen.

Chenqianx commented 11 years ago

Canvas 2D KPIs still met performance regression issue on crosswalk build 2.31.19.0. The latest test result is as below:

  1. http://ie.microsoft.com/testdrive/mobile/Performance/FishIETank/Default.html build 2.31.19.0: 29 fps (~12% drop) build 1.29.8.0: 33 fps build 1.29.4.0: 34 fps
  2. http://www.craftymind.com/factory/guimark3/vector/GM3_JS_Vector.html build 2.31.19.0: 21.3 fps build 1.29.8.0: 24.9 fps build 1.29.4.0: 31.88 fps
  3. http://www.craftymind.com/factory/guimark3/bitmap/GM3_JS_Bitmap.html build 2.31.19.0: 23.6 fps build 1.29.8.0: 21.18 fps build 1.29.4.0: 37.64 fps
  4. http://www.craftymind.com/factory/guimark3/compute/GM3_JS_Compute.html build 2.31.19.0: 25 fps build 1.29.8.0: 22.36 fps build 1.29.4.0: 33.61 fps
ds-hwang commented 11 years ago

@Chenqianx In my opinion, current Canvas performance test regression is not bug. Current tizen is intermediate on the way to final GPU setting. What I mean is that we will turn on threaded-compositing, impl-side-painting, accelerated-2d-canvas, and ubercompositor. Until that, performance can not say a lot. However, this performance log will help us how performance increase each step in the future.

I'll look at how to turn on and check if it is stable, because all are being developed currently.

ininallen commented 11 years ago

This bug has been migrated to JIRA, please track this issue in https://crosswalk-project.org/jira/browse/XWALK-73 . Thanks.