New issue
Advanced search Search tips

Issue 676005 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 666947
Owner: ----
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Very slow JS performance, specially with TypedArrays. Probably an optimization problem introduced in version 55

Reported by ppec...@gmail.com, Dec 20 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36

Steps to reproduce the problem:
1) With the following code:

var typed = new Uint32Array(250000);
var normal = Array.from(typed);         // Just to initialize array with zeroes

function NORMAL() {
    var start = performance.now();
    for (var i = 1, len = normal.length; i < len; ++i) normal[i] = i + normal[i-1];
    console.log("NORMAL: " + (performance.now() - start));
}

function TYPED() {
    var start = performance.now();
    for (var i = 1, len = typed.length; i < len; ++i) typed[i] = i + typed[i-1];
    console.log("TYPED: " + (performance.now() - start));
}

2) executions of TYPED() take up to 25 times SLOWER than executions of NORMAL(), specially after 3 or 4 executions

What is the expected behavior?
Executions of TYPED() should be faster, or at least not so much slower than NORMAL()

What went wrong?
My guess is that the optimizer is not working correctly with TypedArrays since v55

Did this work before? Yes version 54 was working OK, just days ago...

Chrome version: 55.0.2883.87  Channel: stable
OS Version: 6.3
Flash Version: Shockwave Flash 24.0 r0

I have a processing intensive app that deals with rendering images and audio in realtime. Its a vintage computer emulator.
http://webmsx.org

Since version 55 it runs approx. 6 times SLOWER then before.
The culprit seems to be TypedArrays. The same machine in v54 was running the emulation at nearly 900 fps, now it runs at 140 fps.

My code has a function that deals with TypedArrays. This function didn't even show in profiles before v55, and the parent function (the one who calls it) appeared in the profile with no more than 6% of the processing time.

Now the same function appears with about 56% of the processing time! No changes in my code.

The test case above is not really a good representation of my real scenario, but it also looks strange. Profiles of my app can be run and they will show the problem very clearly.

Something is really wrong and that makes Chrome run my project (and I guess other graphics and game-like apps) very poorly. Specially in slower devices like mobiles.

My guess is that some bug in the V8 optimization of TypedArrays was introduced in version 55.
 

Comment 1 Deleted

Comment 2 by woxxom@gmail.com, Dec 20 2016

It was fixed in  issue 666947  and should be pushed to the next autoupdate of Chrome 55.
Components: -Blink Blink>JavaScript

Comment 4 by rtoy@chromium.org, Dec 20 2016

Cc: rtoy@chromium.org
Labels: TE-NeedsTriageHelp

Comment 6 by ppec...@gmail.com, Dec 21 2016

Good to know! Thanks. Do we have a date for the update?

Wow...  Issue 666947  was closed in November!
Does this mean that Chrome v55 was released knowing that it would contain this bug?

Comment 7 by ppec...@gmail.com, Dec 21 2016

Hi, just to clarify.
I have observed this bug in Both Android and Windows.
It's not an ARM specific issue.

Comment 8 by woxxom@gmail.com, Dec 21 2016

#6,7: that issue applies to all OS despite the initial report. And yes, see the decision to ship v55 in comment 24.
Mergedinto: 666947
Status: Duplicate (was: Unconfirmed)

Sign in to add a comment