Commit b12f17ab authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[test] Speed up mjsunit/regress/regress-542823

msunit/regress/regress-542823 is intended to test large object
allocation in Array.prototype.join, but to do so it has a pretty
inefficient way of first building a large array.

Speed-up this test by using Array.prototype.fill, call .join directly,
and make the whole thing an IIFE to avoid global loads.

Bug: v8:11060
Change-Id: I5906bcb6c65b10ec830b026cf1f24acb6d5e1aaf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2498681
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70755}
parent 5fec7ad2
......@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
__v_0 = 100000;
__v_1 = new Array();
for (var __v_2 = 0; __v_2 < __v_0; __v_2++) {
__v_1[__v_2] = 0.5;
}
for (var __v_2 = 0; __v_2 < 10; __v_2++) {
var __v_0 = __v_1 + 0.5;
}
(function() {
const size = 100000;
const arr = Array(size).fill(0.5);
for (let i = 0; i < 10; i++) {
arr.join(",");
}
})();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment