summaryrefslogtreecommitdiffstats
path: root/js/src/devtools/gc-ubench/benchmarks/globalArrayFgFinalized.js
blob: f2f9143762a32facac3993d741854245fff4e785 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
    }
};
})());