Jaguard / time-require

Displays the execution time for Node.js modules loading by hooking require() calls
MIT License
253 stars 20 forks source link

question: what time is measured? #5

Closed junosuarez closed 10 years ago

junosuarez commented 10 years ago

is this measuring the synchronous time of the actual require() calls to load modules, or is it instrumenting and measuring execution time for functions inside those modules and then reporting grouped by module?

cyparu commented 10 years ago

The time-require module actually hook the require() mechanism so the time measured is the _synchronous_ required module initialization (basically the module factory). The original intent for this module was to visually track the slooow dependencies / modules and to postpone and/or laazy require them on-demand.