lib: speed up require(), phase 1
authorBen Noordhuis <info@bnoordhuis.nl>
Tue, 26 May 2015 11:23:26 +0000 (13:23 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Wed, 27 May 2015 19:21:01 +0000 (21:21 +0200)
commitb14fd1a7202cd8001d1f6aed848445bad99ee15c
treeeef47e3ab4ce63db0491171630e7cba61dce6487
parent98649fd31a50d68221a6aa6f58610efb5fae79c6
lib: speed up require(), phase 1

Replace calls to fs.statSync() with an internal variant that does not
create Error or Stat objects that put strain on the garbage collector.

A secondary benefit is that it improves start-up times in the debugger
because it no longer emits thousands of exception debug events.

PR-URL: https://github.com/nodejs/io.js/pull/1801
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
lib/module.js
src/node_file.cc