Debian Codegraph @

js/src/devtools/gc-ubench/benchmarks/globalArrayFgFinalized.js

raw
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 tests.set(
6 "globalArrayFgFinalized",
7 (function() {
8 var garbage = [];
9 var garbageIndex = 0;
10 return {
11 description:
12 "var foo = [ new Map, new Map, ... ]; # (foreground finalized)",
13
14 load: N => {
15 garbage = new Array(N);
16 },
17 unload: () => {
18 garbage = [];
19 garbageIndex = 0;
20 },
21
22 defaultGarbagePiles: "8K",
23 defaultGarbagePerFrame: "48K",
24
25 makeGarbage: N => {
26 var arr = [];
27 for (var i = 0; i < N; i++) {
28 arr.push(new Map());
29 }
30 garbage[garbageIndex++] = arr;
31 if (garbageIndex == garbage.length) {
32 garbageIndex = 0;
33 }
34 },
35 };
36 })()
37 );