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

Unified Diff: test/js-perf-test/Collections/common.js

Issue 685753004: Add performance tests for Map/Set with String and Object keys (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address dslomov comment Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/js-perf-test/Collections/Collections.json ('k') | test/js-perf-test/Collections/map.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/js-perf-test/Collections/common.js
diff --git a/test/js-perf-test/Collections/common.js b/test/js-perf-test/Collections/common.js
new file mode 100644
index 0000000000000000000000000000000000000000..3ea3933374f23419232d5b0feec3dcc6db7bbbf5
--- /dev/null
+++ b/test/js-perf-test/Collections/common.js
@@ -0,0 +1,31 @@
+// Copyright 2014 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.
+
+
+var N = 10;
+var keys;
+
+
+function SetupSmiKeys() {
+ keys = new Array(N * 2);
+ for (var i = 0; i < N * 2; i++) {
+ keys[i] = i;
+ }
+}
+
+
+function SetupStringKeys() {
+ keys = new Array(N * 2);
+ for (var i = 0; i < N * 2; i++) {
+ keys[i] = 's' + i;
+ }
+}
+
+
+function SetupObjectKeys() {
+ keys = new Array(N * 2);
+ for (var i = 0; i < N * 2; i++) {
+ keys[i] = {};
+ }
+}
« no previous file with comments | « test/js-perf-test/Collections/Collections.json ('k') | test/js-perf-test/Collections/map.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698