Commit 6fd25bc6 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[js-perf-test] Remove flaky perf test from mjsunittest...

...and add a js-perf-test instead.

Bug: v8:7726
Change-Id: I0cd17642c76887a5a24f54792625d62b9cee3667
Reviewed-on: https://chromium-review.googlesource.com/1094637
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarDaniel Clifford <danno@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53627}
parent 7a23f5ad
......@@ -76,6 +76,7 @@ load('from.js');
load('of.js');
load('join.js');
load('to-string.js');
load('slice.js');
var success = true;
......
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(() => {
const A = new Array(1000);
for (let i = 0; i < A.length; i++) {
A[i] = i;
}
function testArraySlice500() {
return A.slice(500);
}
function testArraySlice500_999() {
return A.slice(500, 999);
}
function testArraySliceN500() {
return A.slice(-500);
}
function testArraySlice200_700() {
return A.slice(200, 700);
}
function testArraySlice200_N300() {
return A.slice(200, -300);
}
function testArraySlice4_1() {
return A.slice(200, -300);
}
createSuiteWithWarmup("Array.slice(500)", 1, testArraySlice500);
createSuiteWithWarmup("Array.slice(500,999)", 1, testArraySlice500_999);
createSuiteWithWarmup("Array.slice(-500)", 1, testArraySliceN500);
createSuiteWithWarmup("Array.slice(200,700)", 1, testArraySlice200_700);
createSuiteWithWarmup("Array.slice(200,-300)", 1, testArraySlice200_N300);
createSuiteWithWarmup("Array.slice(4,1)", 1, testArraySlice4_1);
})();
(() => {
function assert(condition, message) {
if (!condition) {
throw Error(message);
}
}
const A = new Array(1000);
for (let i = 0; i < A.length; i++) {
A[i] = i;
}
A[100000] = 255;
assert(%HasDictionaryElements(A), "A should be in dictionary mode for this test");
function testArraySlice500_999() {
return A.slice(500, 999);
}
function testArraySlice200_700() {
return A.slice(200, 700);
}
function testArraySlice200_N300() {
return A.slice(200, -300);
}
function testArraySlice4_1() {
return A.slice(200, -300);
}
createSuiteWithWarmup("Array.slice(500,999)-dict", 1, testArraySlice500_999);
createSuiteWithWarmup("Array.slice(200,700)-dict", 1, testArraySlice200_700);
createSuiteWithWarmup("Array.slice(200,-300)-dict", 1, testArraySlice200_N300);
createSuiteWithWarmup("Array.slice(4,1)-dict", 1, testArraySlice4_1);
})();
......@@ -614,7 +614,7 @@
"resources": [
"filter.js", "map.js", "every.js", "join.js", "some.js",
"reduce.js", "reduce-right.js", "to-string.js", "find.js",
"find-index.js", "from.js", "of.js", "for-each.js"
"find-index.js", "from.js", "of.js", "for-each.js", "slice.js"
],
"flags": [
"--allow-natives-syntax"
......@@ -699,7 +699,17 @@
{"name": "DoubleFrom"},
{"name": "StringFrom"},
{"name": "StringNoMapFrom"},
{"name": "MixedFrom"}
{"name": "MixedFrom"},
{"name": "Array.slice(500)"},
{"name": "Array.slice(500,999)"},
{"name": "Array.slice(-500)"},
{"name": "Array.slice(200,700)"},
{"name": "Array.slice(200,-300)"},
{"name": "Array.slice(4,1)"},
{"name": "Array.slice(500,999)-dict"},
{"name": "Array.slice(200,700)-dict"},
{"name": "Array.slice(200,-300)-dict"},
{"name": "Array.slice(4,1)-dict"}
]
},
{
......
......@@ -242,7 +242,6 @@
'osr-elements-kind': [SKIP],
'regress/regress-crbug-137689': [SKIP],
'regress/regress-trap-allocation-memento': [SKIP],
'regress/regress-165637': [SKIP],
'regress/regress-2249': [SKIP],
'regress/regress-4121': [SKIP],
'compare-known-objects-slow': [SKIP],
......@@ -334,10 +333,6 @@
'regress/regress-91013': [SKIP],
'regress/regress-99167': [SKIP],
# Sometimes fails because the hard-coded timeout in the test is exceeded when
# dcheck_always_on = true.
'regress/regress-165637': [SKIP],
# BUG(v8:3457).
'deserialize-reference': [PASS, FAIL],
......@@ -392,8 +387,6 @@
'unicodelctest-no-optimization': [PASS, SLOW],
# Issue 3219:
'getters-on-elements': [PASS, ['gc_stress == True', FAIL]],
# Expects to finish in a certain time, but sometimes doesn't.
'regress/regress-165637': [SKIP],
}], # 'arch == arm64 and mode == debug and simulator_run'
##############################################################################
......@@ -434,7 +427,6 @@
# Too slow.
'harmony/regexp-property-lu-ui': [SKIP],
'regress/regress-165637': [SKIP],
# https://bugs.chromium.org/p/v8/issues/detail?id=7102
# Flaky due to huge string allocation.
......@@ -529,9 +521,6 @@
'try': [PASS, ['mode == debug', SKIP]],
'array-constructor': [PASS, ['mode == debug', SKIP]],
# Expects to finish in a certain time, but in debug mode sometimes doesn't.
'regress/regress-165637': [PASS, ['mode == debug', SKIP]],
# Slow in release mode on MIPS.
'compiler/regress-stacktrace-methods': [PASS, SLOW],
'array-splice': [PASS, SLOW],
......@@ -567,9 +556,6 @@
'try': [PASS, ['mode == debug', SKIP]],
'array-constructor': [PASS, ['mode == debug', SKIP]],
# Expects to finish in a certain time, but in debug mode sometimes doesn't.
'regress/regress-165637': [PASS, ['mode == debug', SKIP]],
# Slow in release mode on MIPS.
'compiler/regress-stacktrace-methods': [PASS, SLOW],
'array-splice': [PASS, SLOW],
......
// Copyright 2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --allow-natives-syntax
// Should not take a very long time (n^2 algorithms are bad)
function do_slices() {
var data = new Array(1024 * 12); // 12kB
for (var i = 0; i < data.length; i++) {
data[i] = 255;
}
var start = Date.now();
for (i = 0; i < 20000; i++) {
data.slice(4, 1);
}
return Date.now() - start;
}
// Should never take more than 3 seconds (if the bug is fixed, the test takes
// considerably less time than 3 seconds).
assertTrue(do_slices() < (3 * 1000));
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Make sure that packed and unpacked array slices are still properly handled
var holey_array = [1, 2, 3, 4, 5,,,,,,];
......
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