diff options
Diffstat (limited to 'js/src/devtools/gc-ubench/benchmarks/globalArrayLargeObject.js')
-rw-r--r-- | js/src/devtools/gc-ubench/benchmarks/globalArrayLargeObject.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/js/src/devtools/gc-ubench/benchmarks/globalArrayLargeObject.js b/js/src/devtools/gc-ubench/benchmarks/globalArrayLargeObject.js new file mode 100644 index 000000000..d676c255e --- /dev/null +++ b/js/src/devtools/gc-ubench/benchmarks/globalArrayLargeObject.js @@ -0,0 +1,23 @@ +window.tests.set('globalArrayLargeObject', (function() { +var garbage = []; +var garbageIndex = 0; +return { + description: "var foo = { LARGE }; # (large slots)", + + load: (N) => { garbage = new Array(N); }, + unload: () => { garbage = []; garbageIndex = 0; }, + + defaultGarbageTotal: "8K", + defaultGarbagePerFrame: "200K", + + makeGarbage: (N) => { + var obj = {}; + for (var i = 0; i < N; i++) { + obj["key" + i] = i; + } + garbage[garbageIndex++] = obj; + if (garbageIndex == garbage.length) + garbageIndex = 0; + } +}; +})()); |