v8/test/js-perf-test/ArraySort/sort-cmpfn.js
Camillo Bruni f728d6984d [js-perf-test] Consistently use createSuite in all benchmarks
Change-Id: I7bf0144bacd0572a42b98d0a0f19df3daf63128b
Bug: chromium:840785
Reviewed-on: https://chromium-review.googlesource.com/1051240
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53418}
2018-05-29 15:06:48 +00:00

21 lines
887 B
JavaScript

// 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.
load('sort-base.js');
// Each benchmark calls sort with multiple different comparison functions
// to create polyomorphic call sites. Most/all of the
// other sort benchmarks have monomorphic call sites.
let sortfn = CreateSortFn([cmp_smaller, cmp_greater]);
createSuite('PackedSmi', 1000, sortfn, CreatePackedSmiArray);
createSuite('PackedDouble', 1000, sortfn, CreatePackedDoubleArray);
createSuite('PackedElement', 1000, sortfn, CreatePackedObjectArray);
createSuite('HoleySmi', 1000, sortfn, CreateHoleySmiArray);
createSuite('HoleyDouble', 1000, sortfn, CreateHoleyDoubleArray);
createSuite('HoleyElement', 1000, sortfn, CreateHoleyObjectArray);
createSuite('Dictionary', 1000, sortfn, CreateDictionaryArray);