busterjs / buster

Abandoned - A powerful suite of automated test tools for JavaScript.
http://docs.busterjs.org
Other
448 stars 37 forks source link

Speedup startup #457

Closed mroderick closed 8 years ago

mroderick commented 9 years ago

TL;DR Use cache-require-paths to make Buster.JS start faster, ~700ms faster on my machine.


Cache node's require lookups for considerable speedup.

To verify

Measure time to run tests with time in a buster dependent project

time buster-test

Checkout this branch and use npm link to make a buster dependent project use this version of Buster.

Repeat the time measurement a couple of times (first succesful one writes the .cache-require-paths.jsonfile).

Calculate any improvement over current Buster.

Results

On my machine with a small project running tests only in node

281 tests, 336 assertions, 1 runtime
Before After
real 0m1.969s 0m1.254s
user 0m1.356s 0m1.144s
sys 0m0.189s 0m0.090s

Speedup: 1969 - 1254 = 715ms

(caveats: on my machine, in my project, using node@0.10, today)

I think the difference is significant enough to add this dependency.

dominykas commented 8 years ago

So far I have two problems with this