New issue
Advanced search Search tips

Issue 704652 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Mar 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 672152



Sign in to add a comment

Optimize the speed of should().beEqualToArray()

Project Member Reported by hongchan@chromium.org, Mar 23 2017

Issue description

As shown in https://bugs.chromium.org/p/chromium/issues/detail?id=703226#c4, we can optimize the speed of should().beEqualToArray() by the factor of 4.

let actual = this._actual;
let expected = this._expected;
for (let index = 0; index < actual.length; index++) {
  if (actual[index] != expected[index])
    errorIndices.push(index);
}
 
We have other instances of for(..in..) in audit.js. We have to fix them as well.
Project Member

Comment 2 by bugdroid1@chromium.org, Mar 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fad633b5888c53d2cf46b6c4ec2eb7d196f7ad3f

commit fad633b5888c53d2cf46b6c4ec2eb7d196f7ad3f
Author: hongchan <hongchan@chromium.org>
Date: Fri Mar 24 14:58:23 2017

Optimize the speed of array iteration in Audit

Some array iterations in Audit are using the new for(..in..)
syntax, which is much slower than the regular for () loop. This CL
replaces all instances of for(..in..) against array with for().

BUG= 704652 

Review-Url: https://codereview.chromium.org/2775713002
Cr-Commit-Position: refs/heads/master@{#459423}

[modify] https://crrev.com/fad633b5888c53d2cf46b6c4ec2eb7d196f7ad3f/third_party/WebKit/LayoutTests/webaudio/resources/audit.js

Status: Verified (was: Started)

Sign in to add a comment