Bug 1125398 - Benchmark load: simple events, r=terrence

--HG--
extra : rebase_source : b7cdda46c91f9cdccf48a5d473b3f6cac5e0ad06
This commit is contained in:
Steve Fink 2015-01-26 15:27:18 -08:00
Родитель 3a74f71bf9
Коммит 5512694ec4
3 изменённых файлов: 53 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,25 @@
window.tests.set('events', (function() {
var garbage = [];
var garbageIndex = 0;
return {
description: "var foo = [ textNode, textNode, ... ]",
load: (N) => { garbage = new Array(N); },
unload: () => { garbage = []; garbageIndex = 0; },
defaultGarbagePerFrame: "100K",
defaultGarbageTotal: "8",
makeGarbage: (N) => {
var a = [];
for (var i = 0; i < N; i++) {
var e = document.createEvent("Events");
e.initEvent("TestEvent", true, true);
a.push(e);
}
garbage[garbageIndex++] = a;
if (garbageIndex == garbage.length)
garbageIndex = 0;
}
};
})());

Просмотреть файл

@ -0,0 +1,26 @@
window.tests.set('expandoEvents', (function() {
var garbage = [];
var garbageIndex = 0;
return {
description: "var foo = [ textNode, textNode, ... ]",
load: (N) => { garbage = new Array(N); },
unload: () => { garbage = []; garbageIndex = 0; },
defaultGarbagePerFrame: "100K",
defaultGarbageTotal: "8",
makeGarbage: (N) => {
var a = [];
for (var i = 0; i < N; i++) {
var e = document.createEvent("Events");
e.initEvent("TestEvent", true, true);
e.color = ["tuna"];
a.push(e);
}
garbage[garbageIndex++] = a;
if (garbageIndex == garbage.length)
garbageIndex = 0;
}
};
})());

Просмотреть файл

@ -18,6 +18,8 @@
<script src="benchmarks/pairCyclicWeakMap.js"></script>
<script src="benchmarks/textNodes.js"></script>
<script src="benchmarks/bigTextNodes.js"></script>
<script src="benchmarks/events.js"></script>
<script src="benchmarks/expandoEvents.js"></script>
<script src="harness.js"></script>