Remove slow ArrayLiteralInitialSpread benchmarks to avoid timeout.

Cloning arrays with Array.prototype.map and for-of push is too slow
for large arrays.

Bug: chromium:878681
Change-Id: I70ba5faad9e19cdc5a39cc64fb1b4bcb3fd0bf48
Reviewed-on: https://chromium-review.googlesource.com/1195363
Commit-Queue: Hai Dang <dhai@google.com>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55496}
This commit is contained in:
Hai Dang 2018-08-29 16:09:56 +02:00 committed by Commit Bot
parent d13e9c692e
commit 0c6c2235be
3 changed files with 14 additions and 16 deletions

View File

@ -5,7 +5,7 @@
// Comparing different copy schemes against spread initial literals.
// Benchmarks for large holey arrays.
const largeHoleyArray = new Array(100000);
const largeHoleyArray = new Array(1e5);
for (var i = 0; i < 100; i++) {
largeHoleyArray[i] = i;
@ -140,9 +140,9 @@ function PrintError(name, error) {
success = false;
}
// Run the benchmark (20 x 100) iterations instead of 1 second.
// Run the benchmark (5 x 100) iterations instead of 1 second.
function CreateBenchmark(name, f) {
new BenchmarkSuite(name, [1000], [ new Benchmark(name, false, false, 20, f) ]);
new BenchmarkSuite(name, [1000], [ new Benchmark(name, false, false, 5, f) ]);
}
CreateBenchmark('Spread', SpreadLargeHoley);
@ -152,8 +152,9 @@ CreateBenchmark('Slice', SliceLargeHoley);
CreateBenchmark('Slice0', Slice0LargeHoley);
CreateBenchmark('ConcatReceive', ConcatReceiveLargeHoley);
CreateBenchmark('ConcatArg', ConcatArgLargeHoley);
CreateBenchmark('ForOfPush', ForOfPushLargeHoley);
CreateBenchmark('MapId', MapIdLargeHoley);
// The following benchmarks are so slow that they will time out.
// CreateBenchmark('ForOfPush', ForOfPushLargeHoley);
// CreateBenchmark('MapId', MapIdLargeHoley);
BenchmarkSuite.config.doWarmup = true;

View File

@ -5,7 +5,7 @@
// Comparing different copy schemes against spread initial literals.
// Benchmarks for large packed arrays.
const largeHoleyArray = new Array(100000);
const largeHoleyArray = new Array(1e5);
const largeArray = Array.from(largeHoleyArray.keys());
// ----------------------------------------------------------------------------
@ -133,9 +133,9 @@ function PrintError(name, error) {
success = false;
}
// Run the benchmark (20 x 100) iterations instead of 1 second.
// Run the benchmark (5 x 100) iterations instead of 1 second.
function CreateBenchmark(name, f) {
new BenchmarkSuite(name, [1000], [ new Benchmark(name, false, false, 20, f) ]);
new BenchmarkSuite(name, [1000], [ new Benchmark(name, false, false, 5, f) ]);
}
CreateBenchmark('Spread', SpreadLarge);
@ -145,8 +145,9 @@ CreateBenchmark('Slice', SliceLarge);
CreateBenchmark('Slice0', Slice0Large);
CreateBenchmark('ConcatReceive', ConcatReceiveLarge);
CreateBenchmark('ConcatArg', ConcatArgLarge);
CreateBenchmark('ForOfPush', ForOfPushLarge);
CreateBenchmark('MapId', MapIdLarge);
// The following benchmarks are so slow that they will time out.
// CreateBenchmark('ForOfPush', ForOfPushLarge);
// CreateBenchmark('MapId', MapIdLarge);
BenchmarkSuite.config.doWarmup = true;
BenchmarkSuite.config.doDeterministic = true;

View File

@ -90,9 +90,7 @@
{"name": "Slice"},
{"name": "Slice0"},
{"name": "ConcatReceive"},
{"name": "ConcatArg"},
{"name": "ForOfPush"},
{"name": "MapId"}
{"name": "ConcatArg"}
]
},
{
@ -126,9 +124,7 @@
{"name": "Slice"},
{"name": "Slice0"},
{"name": "ConcatReceive"},
{"name": "ConcatArg"},
{"name": "ForOfPush"},
{"name": "MapId"}
{"name": "ConcatArg"}
]
},
{