Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Issue 1331993004: [es6] Optimize TypedArray.subarray() (Closed)

Created:
5 years, 3 months ago by skomski
Modified:
5 years, 2 months ago
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[es6] Optimize TypedArray.subarray() ```` var array = new Uint8Array(65000); var startDate = Date.now(); var counter = 0; while (counter++ < 50000000) { array.subarray(start, end); } var endDate = Date.now(); print(endDate - startDate); ```` 4200 ms -> 3500 ms (16.67%) BUG= Committed: https://crrev.com/1e2aecf3635a5fb01607fa65511d67902735d90c Cr-Commit-Position: refs/heads/master@{#30770}

Patch Set 1 #

Patch Set 2 : macro version #

Patch Set 3 : remove unused references #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -11 lines) Patch
M src/macros.py View 1 1 chunk +2 lines, -0 lines 1 comment Download
M src/typedarray.js View 1 2 2 chunks +11 lines, -11 lines 0 comments Download

Messages

Total messages: 17 (3 generated)
skomski
PTAL
5 years, 3 months ago (2015-09-10 19:36:50 UTC) #2
Jakob Kummerow
I'm not sure about this one. Replacing MathMax() calls with verbose hand-written comparisons for performance ...
5 years, 3 months ago (2015-09-11 09:52:26 UTC) #3
skomski
On 2015/09/11 09:52:26, Jakob wrote: > I'm not sure about this one. > > Replacing ...
5 years, 3 months ago (2015-09-11 10:04:48 UTC) #4
Dan Ehrenberg
On 2015/09/11 at 10:04:48, karl wrote: > On 2015/09/11 09:52:26, Jakob wrote: > > I'm ...
5 years, 3 months ago (2015-09-11 13:53:15 UTC) #5
Jakob Kummerow
On 2015/09/11 13:53:15, Dan Ehrenberg wrote: > Agreed that this is sad. Inlining JS natives ...
5 years, 3 months ago (2015-09-11 15:03:45 UTC) #6
skomski
On 2015/09/11 15:03:45, Jakob wrote: > On 2015/09/11 13:53:15, Dan Ehrenberg wrote: > > Agreed ...
5 years, 3 months ago (2015-09-14 17:56:29 UTC) #7
skomski
Since the subarray patch landed in nodejs it would be great to land this, too. ...
5 years, 3 months ago (2015-09-16 15:01:08 UTC) #8
Dan Ehrenberg
On 2015/09/16 at 15:01:08, karl wrote: > Since the subarray patch landed in nodejs it ...
5 years, 3 months ago (2015-09-16 15:44:45 UTC) #9
Dan Ehrenberg
On 2015/09/16 at 15:44:45, Dan Ehrenberg wrote: > On 2015/09/16 at 15:01:08, karl wrote: > ...
5 years, 3 months ago (2015-09-16 15:46:09 UTC) #10
Dan Ehrenberg
lgtm
5 years, 3 months ago (2015-09-16 15:46:28 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1331993004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1331993004/40001
5 years, 3 months ago (2015-09-16 15:58:49 UTC) #13
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 3 months ago (2015-09-16 16:21:41 UTC) #14
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/1e2aecf3635a5fb01607fa65511d67902735d90c Cr-Commit-Position: refs/heads/master@{#30770}
5 years, 3 months ago (2015-09-16 16:22:07 UTC) #15
Michael Starzinger
5 years, 2 months ago (2015-10-07 18:49:07 UTC) #17
Message was sent while issue was closed.
Hmmm ...

https://codereview.chromium.org/1331993004/diff/40001/src/macros.py
File src/macros.py (right):

https://codereview.chromium.org/1331993004/diff/40001/src/macros.py#newcode160
src/macros.py:160: macro MAX_SIMPLE(argA, argB) = (argA < argB ? argB : argA);
Please be aware that this macro will expand "MAX_SIMPLE(a + b, 0)" to "a + b < 0
? a + b : 0" which will evaluate the addition twice in the baseline compiler
(which is the only compiler where this macro makes any sense in the first
place).

If you wanted to guard against that, then the %IS_VAR marker would be the right
thing. But then you would need to adapt the use-sites accordingly. And I see
that this is now being used left and right in the builtin JavaScript files and
almost all use-sites are affected.

Powered by Google App Engine
This is Rietveld 408576698