Bug 1125398 - Benchmark load: arrays of Map (for foreground finalized), r=terrence
authorSteve Fink <sfink@mozilla.com>
Wed, 21 Jan 2015 13:41:43 -0800
changeset 239489 97c12091bda58529f25bb518ff5f77c97ede55a8
parent 239488 8a5b30881128be12d13d0ce15d140cfa107ce5fb
child 239490 b5a4e4c8ed85adfae07a5e466af55f4e3e0e7fac
push id500
push userjoshua.m.grant@gmail.com
push dateThu, 29 Jan 2015 01:48:36 +0000
reviewersterrence
bugs1125398
milestone38.0a1
Bug 1125398 - Benchmark load: arrays of Map (for foreground finalized), r=terrence
js/src/devtools/gc-ubench/benchmarks/globalArrayFgFinalized.js
js/src/devtools/gc-ubench/index.html
new file mode 100644
--- /dev/null
+++ b/js/src/devtools/gc-ubench/benchmarks/globalArrayFgFinalized.js
@@ -0,0 +1,23 @@
+window.tests.set('globalArrayFgFinalized', (function() {
+var garbage = [];
+var garbageIndex = 0;
+return {
+    description: "var foo = [ new Map, new Map, ... ]; # (foreground finalized)",
+
+    load: (N) => { garbage = new Array(N); },
+    unload: () => { garbage = []; garbageIndex = 0; },
+
+    defaultGarbageTotal: "8K",
+    defaultGarbagePerFrame: "1M",
+
+    makeGarbage: (N) => {
+        var arr = [];
+        for (var i = 0; i < N; i++) {
+            arr.push(new Map);
+        }
+        garbage[garbageIndex++] = arr;
+        if (garbageIndex == garbage.length)
+            garbageIndex = 0;
+    }
+};
+})());
--- a/js/src/devtools/gc-ubench/index.html
+++ b/js/src/devtools/gc-ubench/index.html
@@ -8,16 +8,17 @@
   <script src="benchmarks/noAllocation.js"></script>
   <script src="benchmarks/globalArrayNewObject.js"></script>
   <script src="benchmarks/globalArrayArrayLiteral.js"></script>
   <script src="benchmarks/globalArrayLargeArray.js"></script>
   <script src="benchmarks/globalArrayLargeObject.js"></script>
   <script src="benchmarks/globalArrayObjectLiteral.js"></script>
   <script src="benchmarks/globalArrayReallocArray.js"></script>
   <script src="benchmarks/globalArrayBuffer.js"></script>
+  <script src="benchmarks/globalArrayFgFinalized.js"></script>
   <script src="benchmarks/selfCyclicWeakMap.js"></script>
   <script src="benchmarks/pairCyclicWeakMap.js"></script>
   <script src="benchmarks/textNodes.js"></script>
   <script src="benchmarks/bigTextNodes.js"></script>
 
   <script src="harness.js"></script>
 
 </head>