[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: Maya Lekova <mslekova@chromium.org> Cr-Commit-Position: refs/heads/master@{#70755}
This commit is contained in:
parent
5fec7ad225
commit
b12f17abac
@ -2,11 +2,12 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
__v_0 = 100000;
|
(function() {
|
||||||
__v_1 = new Array();
|
|
||||||
for (var __v_2 = 0; __v_2 < __v_0; __v_2++) {
|
const size = 100000;
|
||||||
__v_1[__v_2] = 0.5;
|
const arr = Array(size).fill(0.5);
|
||||||
}
|
for (let i = 0; i < 10; i++) {
|
||||||
for (var __v_2 = 0; __v_2 < 10; __v_2++) {
|
arr.join(",");
|
||||||
var __v_0 = __v_1 + 0.5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
})();
|
||||||
|
Loading…
Reference in New Issue
Block a user