mathiasbynens/jsperf.com

Any way to force GC or pause before tests run?

Closed this issue · 1 comments

Hi,

Am trying to test the effects of loading large numbers of large classes in Ext.

As such have had a go at writing a test that attempts to simulate this, here: http://jsperf.com/test-effect-of-code-weight-in-ext
This test has been through a few iterations, but I think the current state should be close to what I need.

The issue I have is the fact that I think the test run is starting whilst garbage collection is still occurring.

Is there any way to stall execution whilst this GC is carried out?
Any other suggestions of how I can test the effects of clearing up all the loaded code?

Regards,
Westy

You init what you need in the HTML setup instead of the benchmark setup that might help, it looks like your clearing state on teardown which is good.

jsPerf tests are constructed like:

<setup>
while (count--) {
  <test>
}
<teardown>