New issue
Advanced search Search tips

Issue 910768 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Today
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Bad performance of putImageData()

Reported by mfc...@gmail.com, Nov 30

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36

Steps to reproduce the problem:
1. Open https://mfcc64.github.io/html5-showcqtbar/index.html?s=1600x600
2. Record the performance

What is the expected behavior?
putImageData() should be fast

What went wrong?
putImageData() is slow. Even it is slower than showcqtbar.render_line(). Previously, it was fast.

Did this work before? Yes 62.0.3202.94

Does this work in other browsers? N/A

Chrome version: 70.0.3538.110  Channel: stable
OS Version: 
Flash Version:
 
profile.zip
576 KB Download
Labels: Needs-Bisect Needs-Triage-M70
Cc: viswa.karala@chromium.org
Components: Platform>DevTools
Labels: Needs-Feedback Triaged-ET
Tried testing the issue on chrome reported version# 70.0.3538.110 using Linux 14.04 with steps mentioned below:
1) Launched chrome reported version and navigated(https://mfcc64.github.io/html5-showcqtbar/index.html?s=1600x600) to URL provided in comment# 0
2) Opened Devtools > Performance tab and clicked on record button and recorded it
3) Clicked on Bottom-Up tab, able to see self time(1120.0 ms) & Total time(1120.0 ms) for putImageData and self time(0.3 ms) & Total times(244.0 ms) for ShowCQTBar.render_line

@Reporter: Please find the attached screencast for your reference and provide your feedback on it which help in further triaging it in better way.
Note: Tentatively adding Platform>Devtools component to it

Thanks!


910768.webm
3.4 MB View Download
I attached performance profile, here.

Summary:
Old performance on profile-62.0.3202.94.json
  total time of showcqtbar.render_line: 735.5 ms
  total time of putImageData:           335.7 ms

New performance on profile-70.0.3538.11.json
  total time of showcqtbar.render_line: 599.2 ms
  total time of putImageData:          1109.9 ms

Thank's.
profile.zip
575 KB Download
Project Member

Comment 4 by sheriffbot@chromium.org, Dec 3

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Components: -Platform>DevTools Internals>GPU>Canvas2D
Labels: Needs-Feedback
Tested the issue on chrome reported version# 70.0.3538.110 and on #62.0.3202.94 using Ubuntu 14.04 and observations are as follows:

Chrome version# 70.0.3538.110:
Total time of showcqtbar.render_line: 257.6 ms
Total time of putImageData:           773.4 ms
Chrome version# 62.0.3202.94:
Total time of showcqtbar.render_line: 117.0 ms
Total time of putImageData:           339.0 ms

@Reporter: Please find the attached screencast for your reference and let us know if we missed anything in reproducing it, provide your feedback on it.

Thanks!
910768 - 70.0.3538.110.webm
2.7 MB View Download
910768 - 62.0.3202.94.webm
4.1 MB View Download
So, on your platform, we can conclude that
on 70.0.3538.110: speed of putImageData() = 0.333 x speed of render_line()
on 62.0.3202.94 : speed of putImageData() = 0.345 x speed of render_line().
Seems that on your platform, the performance loss is not significant.

I attach files that do benchmark on putImageData().

Here, the result on my platform (Fedora 28 on Intel Celeron N3350 and GPU Intel HD Graphic 500 (Broxton 2x6).

performance of putImageData() at 1600x600
version: 62.0.3202.94
    with alpha:     173 fps
    without alpha:  177 fps

version: 70.0.3538.110
    with alpha:     206 fps
    without alpha:  110 fps

Seem that new chrome try to optimize canvas with alpha channel at the cost of performance loss on canvas without alpha channel.

Thank's.


perf-canvas-alpha.html
1.1 KB View Download
perf-canvas-noalpha.html
1.1 KB View Download
Project Member

Comment 8 by sheriffbot@chromium.org, Dec 4

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Needs-Bisect Needs-Feedback
Tried testing the issue on chrome reported version# 70.0.3538.110 with sample files provided in comment# 7 and observations are as follows:

version: 62.0.3202.94
    with alpha:    211 fps
    without alpha: 253 fps

version: 70.0.3538.110
    with alpha:    203 fps
    without alpha: 210 fps

@Reporter: Please find the attached screenshots for your reference and provide your feedback on it.
Note: As per comment# 2 & 6, unable to reproduce the issue from TE end, hence removing Needs-Bisect label.

Thanks!
910768 - 62.0.3202.94.png
83.0 KB View Download
910768 - 70.0.3538.110.png
79.7 KB View Download
There are slightly performance loss on your platform. However the result probably isn't reliable because it only runs once.

So, I attach new benchmark file, here. And test it using some versions of chrome from https://www.slimjet.com/chrome/google-chrome-old-version.php
I also test it on firefox (59.0.2)

Here, the result in fps

version     alpha   noalpha
66          235     239
67          236     238
68          240     153
69          287     125
70          287     125
---------------------------
firefox     515     505

Thank's
perf-canvas.html
2.7 KB View Download
Project Member

Comment 11 by sheriffbot@chromium.org, Dec 6

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Owner: fs...@chromium.org
Status: Assigned (was: Unconfirmed)
From the test results in #6 and #9 we are seeing a meaningful regression. 

fserb@, can you take a look for the potential Canvas issue?

After investigating, I found that uploading texture from rgba to rgb internal format is slow on my platform.
Cc: fs...@chromium.org
Owner: aaronhk@chromium.org

Comment 15 by aaronhk@chromium.org, Jan 18 (4 days ago)

I get good results for both above tests on dev. 

perf-canvas-noalpha.html, 10 runs
-----------------------
71.0.3578.98 (stable)
  Average: 219 fps
  Median: 199 fps

73.0.3677.0 (dev)
  Average: 3530 fps
  Median: 3346 fps

perf-canvas-alpha.html, 10 runs
-----------------------
71.0.3578.98 (stable)
  Average: 223 fps
  Median: 204 fps

73.0.3677.0 (dev)
  Average: 3572 fps
  Median: 3318 fps

So there's actually a huge improvement there (don't know why)
  
For the https://mfcc64.github.io/html5-showcqtbar/index.html?s=1600x600 test, it appears that the ratio of putImageData/_render_line is highly dependent on how much refreshing you do vs how long you let it run (more refreshes means higher ratio). So this is not a great test.

Attached are slight modifications of the perf-canvas-(no)alpha tests so you can run statistics.  I'll try running on older versions next, but from my perspective there is no regression here.

Comment 16 by aaronhk@chromium.org, Today (14 hours ago)

Status: WontFix (was: Assigned)
Marking as WontFix, see #15 for justification.

Sign in to add a comment