I am trying to run the tests/blink_perf_tests/perf_tests/ and the layout tests seem to heavily rely on tests/blink_perf_tests/perf_tests/resources/runner.js, which has this function:
PerfTestRunner.gc = function () {
if (window.GCController)
window.GCController.collectAll();
else {
function gcRec(n) {
if (n < 1)
return {};
var temp = {i: "ab" + i + (i / 100000)};
temp += "foo";
gcRec(n-1);
}
for (var i = 0; i < 1000; i++)
gcRec(10);
}
};
which tries to do "Garbage Collection" using so called window.GCController, which fails and runs recursive allocation till gc kicks in.
I wonder if we could use the navigator.servo.garbageCollectAllContexts() that is available on the about:memory page and is evoked when force gc button is pressed.
We could have a chromium style (--js-flags="--expose-gc") pref arg, so that the access to navigator.servo.garbageCollectAllContexts() is optional.
I want to implement this. Is it generally a good idea?
I speculate that this would reduce wait time in between blink-perf-tests and thus make total test time shorter.
I am trying to run the
tests/blink_perf_tests/perf_tests/and thelayouttests seem to heavily rely ontests/blink_perf_tests/perf_tests/resources/runner.js, which has this function:which tries to do "Garbage Collection" using so called
window.GCController, which fails and runs recursive allocation till gc kicks in.I wonder if we could use the
navigator.servo.garbageCollectAllContexts()that is available on theabout:memorypage and is evoked whenforce gcbutton is pressed.We could have a chromium style (
--js-flags="--expose-gc") pref arg, so that the access tonavigator.servo.garbageCollectAllContexts()is optional.I want to implement this. Is it generally a good idea?
I speculate that this would reduce wait time in between blink-perf-tests and thus make total test time shorter.