From 0c6c2235beed53d2c756dada384f1a09da10a0eb Mon Sep 17 00:00:00 2001 From: Hai Dang Date: Wed, 29 Aug 2018 16:09:56 +0200 Subject: [PATCH] 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 Reviewed-by: Georg Neis Cr-Commit-Position: refs/heads/master@{#55496} --- .../ArrayLiteralInitialSpreadLargeHoley/run.js | 11 ++++++----- .../ArrayLiteralInitialSpreadLargePacked/run.js | 11 ++++++----- test/js-perf-test/JSTests.json | 8 ++------ 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/test/js-perf-test/ArrayLiteralInitialSpreadLargeHoley/run.js b/test/js-perf-test/ArrayLiteralInitialSpreadLargeHoley/run.js index b56efe9836..2a4aff2ee7 100644 --- a/test/js-perf-test/ArrayLiteralInitialSpreadLargeHoley/run.js +++ b/test/js-perf-test/ArrayLiteralInitialSpreadLargeHoley/run.js @@ -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; diff --git a/test/js-perf-test/ArrayLiteralInitialSpreadLargePacked/run.js b/test/js-perf-test/ArrayLiteralInitialSpreadLargePacked/run.js index e4bac551c9..38643c6903 100644 --- a/test/js-perf-test/ArrayLiteralInitialSpreadLargePacked/run.js +++ b/test/js-perf-test/ArrayLiteralInitialSpreadLargePacked/run.js @@ -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; diff --git a/test/js-perf-test/JSTests.json b/test/js-perf-test/JSTests.json index addca5a2b9..c2aacb452f 100644 --- a/test/js-perf-test/JSTests.json +++ b/test/js-perf-test/JSTests.json @@ -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"} ] }, {