Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1349)

Side by Side Diff: test/js-perf-test/TypedArrays/typedarrays.js

Issue 2676193002: [tests] add microbenchmark for %TypedArray%.prototype.copyWithin (Closed)
Patch Set: Remove heap-symbols.h change Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/js-perf-test/TypedArrays/run.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 new BenchmarkSuite('CopyWithin', [1000], [
6 new Benchmark('CopyWithin-Large', false, false, 0,
7 CopyWithinLarge, CopyWithinLargeSetup, CopyWithinLargeTearDown),
8 ]);
9
10 var initialLargeFloat64Array = new Array(10000);
11 for (var i = 0; i < 5000; ++i) {
12 initialLargeFloat64Array[i] = i;
13 }
14 initialLargeFloat64Array = new Float64Array(initialLargeFloat64Array);
15 var largeFloat64Array;
16
17 function CopyWithinLarge() {
18 largeFloat64Array.copyWithin(5000);
19 }
20
21 function CopyWithinLargeSetup() {
22 largeFloat64Array = new Float64Array(initialLargeFloat64Array);
23 }
24
25 function CopyWithinLargeTearDown() {
26 for (var i = 0; i < 5000; ++i) {
27 if (largeFloat64Array[i + 5000] !== i) {
28 throw new TypeError("Unexpected result!\n" + largeFloat64Array);
29 }
30 }
31 largeFloat64Array = void 0;
32 }
OLDNEW
« no previous file with comments | « test/js-perf-test/TypedArrays/run.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698