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

Issue 2823343004: [js-perf-test] Add microbenchmarks for materialized rest parameters. (Closed)

Created:
3 years, 8 months ago by Benedikt Meurer
Modified:
3 years, 8 months ago
Reviewers:
Yang
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/heads/master
Project:
v8
Visibility:
Public.

Description

[js-perf-test] Add microbenchmarks for materialized rest parameters. Functions that take mandatory parameters plus a number of optional parameters, that need to be materialized as an Array are quite common. The simplest possible case of this is essentially: function foo(mandatory, ...args) { return args; } Babel translates this to something like: function foo(mandatory) { "use strict"; for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } return args; } The key to great performance here is to make sure that we don't materialize the (unmapped) arguments object in this case, plus that we have some kind of fast-path for the Array constructor and the initialization loop. This microbenchmark ensures that we have decent performance even in the case where the assignment to args is polymorphic, i.e. the arguments have seen different elements kinds, starting with FAST_HOLEY_ELEMENTS and then FAST_HOLEY_SMI_ELEMENTS. R=yangguo@chromium.org BUG=v8:6262 Review-Url: https://codereview.chromium.org/2823343004 Cr-Commit-Position: refs/heads/master@{#44709} Committed: https://chromium.googlesource.com/v8/v8/+/07e163bd5ac87cfb9539dfe3c2b0b1337e97985a

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+69 lines, -1 line) Patch
M test/js-perf-test/JSTests.json View 1 chunk +3 lines, -1 line 0 comments Download
M test/js-perf-test/RestParameters/rest.js View 2 chunks +66 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (6 generated)
Benedikt Meurer
3 years, 8 months ago (2017-04-19 04:55:42 UTC) #1
Benedikt Meurer
Hey Yang, Here's a js-perf-test for the materialized rest parameters case, both native and transpiled. ...
3 years, 8 months ago (2017-04-19 04:56:35 UTC) #4
Yang
lgtm
3 years, 8 months ago (2017-04-19 05:11:38 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2823343004/1
3 years, 8 months ago (2017-04-19 05:12:06 UTC) #8
commit-bot: I haz the power
3 years, 8 months ago (2017-04-19 05:25:47 UTC) #11
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/v8/v8/+/07e163bd5ac87cfb9539dfe3c2b0b1337e9...

Powered by Google App Engine
This is Rietveld 408576698