lib: optimize require() path walking
authorBen Noordhuis <info@bnoordhuis.nl>
Tue, 9 Dec 2014 17:57:43 +0000 (18:57 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Tue, 9 Dec 2014 21:11:46 +0000 (22:11 +0100)
commitddf17f995b313c09641c9af96750188e470d0665
tree647750fe29f1b66c2c595e6f15fc9e5466ce679c
parent535fec83ea890775c31cbe041fc19db9c4b7ff1f
lib: optimize require() path walking

Remove a speed bump from commit 36777d2 by reusing the result of the
previous stat() system call.  It's a code path that gets called many
thousands of times at startup in most applications so shaving off an
extra system call can have an appreciable impact on startup times.

PR-URL: https://github.com/iojs/io.js/pull/130
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
lib/module.js