Commit 0c6c2235 authored by Hai Dang's avatar Hai Dang Committed by Commit Bot

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: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55496}
parent d13e9c69
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// Comparing different copy schemes against spread initial literals. // Comparing different copy schemes against spread initial literals.
// Benchmarks for large holey arrays. // Benchmarks for large holey arrays.
const largeHoleyArray = new Array(100000); const largeHoleyArray = new Array(1e5);
for (var i = 0; i < 100; i++) { for (var i = 0; i < 100; i++) {
largeHoleyArray[i] = i; largeHoleyArray[i] = i;
...@@ -140,9 +140,9 @@ function PrintError(name, error) { ...@@ -140,9 +140,9 @@ function PrintError(name, error) {
success = false; 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) { 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); CreateBenchmark('Spread', SpreadLargeHoley);
...@@ -152,8 +152,9 @@ CreateBenchmark('Slice', SliceLargeHoley); ...@@ -152,8 +152,9 @@ CreateBenchmark('Slice', SliceLargeHoley);
CreateBenchmark('Slice0', Slice0LargeHoley); CreateBenchmark('Slice0', Slice0LargeHoley);
CreateBenchmark('ConcatReceive', ConcatReceiveLargeHoley); CreateBenchmark('ConcatReceive', ConcatReceiveLargeHoley);
CreateBenchmark('ConcatArg', ConcatArgLargeHoley); CreateBenchmark('ConcatArg', ConcatArgLargeHoley);
CreateBenchmark('ForOfPush', ForOfPushLargeHoley); // The following benchmarks are so slow that they will time out.
CreateBenchmark('MapId', MapIdLargeHoley); // CreateBenchmark('ForOfPush', ForOfPushLargeHoley);
// CreateBenchmark('MapId', MapIdLargeHoley);
BenchmarkSuite.config.doWarmup = true; BenchmarkSuite.config.doWarmup = true;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// Comparing different copy schemes against spread initial literals. // Comparing different copy schemes against spread initial literals.
// Benchmarks for large packed arrays. // Benchmarks for large packed arrays.
const largeHoleyArray = new Array(100000); const largeHoleyArray = new Array(1e5);
const largeArray = Array.from(largeHoleyArray.keys()); const largeArray = Array.from(largeHoleyArray.keys());
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
...@@ -133,9 +133,9 @@ function PrintError(name, error) { ...@@ -133,9 +133,9 @@ function PrintError(name, error) {
success = false; 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) { 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); CreateBenchmark('Spread', SpreadLarge);
...@@ -145,8 +145,9 @@ CreateBenchmark('Slice', SliceLarge); ...@@ -145,8 +145,9 @@ CreateBenchmark('Slice', SliceLarge);
CreateBenchmark('Slice0', Slice0Large); CreateBenchmark('Slice0', Slice0Large);
CreateBenchmark('ConcatReceive', ConcatReceiveLarge); CreateBenchmark('ConcatReceive', ConcatReceiveLarge);
CreateBenchmark('ConcatArg', ConcatArgLarge); CreateBenchmark('ConcatArg', ConcatArgLarge);
CreateBenchmark('ForOfPush', ForOfPushLarge); // The following benchmarks are so slow that they will time out.
CreateBenchmark('MapId', MapIdLarge); // CreateBenchmark('ForOfPush', ForOfPushLarge);
// CreateBenchmark('MapId', MapIdLarge);
BenchmarkSuite.config.doWarmup = true; BenchmarkSuite.config.doWarmup = true;
BenchmarkSuite.config.doDeterministic = true; BenchmarkSuite.config.doDeterministic = true;
......
...@@ -90,9 +90,7 @@ ...@@ -90,9 +90,7 @@
{"name": "Slice"}, {"name": "Slice"},
{"name": "Slice0"}, {"name": "Slice0"},
{"name": "ConcatReceive"}, {"name": "ConcatReceive"},
{"name": "ConcatArg"}, {"name": "ConcatArg"}
{"name": "ForOfPush"},
{"name": "MapId"}
] ]
}, },
{ {
...@@ -126,9 +124,7 @@ ...@@ -126,9 +124,7 @@
{"name": "Slice"}, {"name": "Slice"},
{"name": "Slice0"}, {"name": "Slice0"},
{"name": "ConcatReceive"}, {"name": "ConcatReceive"},
{"name": "ConcatArg"}, {"name": "ConcatArg"}
{"name": "ForOfPush"},
{"name": "MapId"}
] ]
}, },
{ {
......
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