Commit d34cbcd7 authored by Hai Dang's avatar Hai Dang Committed by Commit Bot

[js-perf-tests] Fix micro-benchmark of spreading double arrays.

Array.prototype.map is currently not preserving PACKEDness. Use a
for-loop instead.

Bug: v8:7980
Change-Id: I08aff1cbcd84b9de260a5a1e2c68b9cfb5c3d888
Reviewed-on: https://chromium-review.googlesource.com/c/1280329
Commit-Queue: Hai Dang <dhai@google.com>
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56657}
parent 1556cdea
......@@ -5,8 +5,12 @@
// Comparing different copy schemes against spread initial literals.
// Benchmarks for large packed double arrays.
const largeHoleyArray = new Array(1e5);
const largeArray = Array.from(largeHoleyArray.keys()).map(x => x + 6.66);
var largeArray = Array.from(Array(1e5).keys());
// TODO(dhai): we should be able to use Array.prototype.map here, but that
// implementation is currently creating a HOLEY array.
for (var i = 0; i < 1e5; i++) {
largeArray[i] += 6.66;
}
// ----------------------------------------------------------------------------
// Benchmark: Spread
......
......@@ -5,8 +5,7 @@
// Comparing different copy schemes against spread initial literals.
// Benchmarks for large packed arrays.
const largeHoleyArray = new Array(1e5);
const largeArray = Array.from(largeHoleyArray.keys());
const largeArray = Array.from(Array(1e5).keys());
// ----------------------------------------------------------------------------
// Benchmark: Spread
......
......@@ -5,8 +5,12 @@
// Comparing different copy schemes against spread initial literals.
// Benchmarks for small packed double arrays.
const smallHoleyArray = Array(100);
const smallArray = Array.from(Array(100).keys()).map(x => x + 6.66);;
var smallArray = Array.from(Array(100).keys());
for (var i = 0; i < 100; i++) {
smallArray[i] += 6.66;
}
// ----------------------------------------------------------------------------
// Benchmark: Spread
......
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