Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

randomly and slow require() calls on startup #25477

Closed
elijahiuu opened this issue Jun 4, 2015 · 2 comments
Closed

randomly and slow require() calls on startup #25477

elijahiuu opened this issue Jun 4, 2015 · 2 comments

Comments

@elijahiuu
Copy link

I run gulp on the same osx laptop and get considerably different startup performance from run to run. It happens in batches. 1 hour everything is super fast, another hour everything is 10x slower. And only on the require() step.

Here are two runs of the same gulp process:

gulp -T --require time-require --verbose --sorted

Start time: (2015-06-04 14:04:26 UTC) [treshold=0%,sorted]
  # [order]  module                                                                       time  %
   1 [4297]  /Users/xxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxx/gulpfile.js (gulpfile.js)        1m 8.7s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100%
   2 [1734]  /Users/xxxxxxx/xxxxxxxxxxxxxxxxxxxx...rify.js (gulp/tasks/browserify.js)    11.6s  ▇▇▇▇▇▇▇▇▇▇▇▇▇ 17%
   3  [817]  /Users/xxxxxxx/xxxxxxxxxxxxxxxxxxxx...ync.js (gulp/tasks/browserSync.js)    10.6s  ▇▇▇▇▇▇▇▇▇▇▇▇ 15%
   4 [2764]  /Users/xxxxxxx/xxxxxxxxxxxxxxxxxxxx...sks/karma.js (gulp/tasks/karma.js)     9.7s  ▇▇▇▇▇▇▇▇▇▇▇ 14%
   5 [2763]  karma (node_modules/karma/lib/index.js)                                      9.7s  ▇▇▇▇▇▇▇▇▇▇▇ 14%
   6 [2756]  ./server (node_modules/karma/lib/server.js)                                  9.6s  ▇▇▇▇▇▇▇▇▇▇ 14%
   7 [4182]  /Users/xxxxxxx/xxxxxxxxxxxxxxxxxxxx...s/styles.js (gulp/tasks/styles.js)     9.1s  ▇▇▇▇▇▇▇▇▇▇ 13%
    # [order]  module                                                                     time  %
   1 [4297]  /Users/xxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxx/gulpfile.js (gulpfile.js)         2.3s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 97%
   2 [1734]  /Users/xxxxxxx/xxxxxxxxxxxxxxxxxxxx...rify.js (gulp/tasks/browserify.js)  563ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 24%
   3  [817]  /Users/xxxxxxx/xxxxxxxxxxxxxxxxxxxx...ync.js (gulp/tasks/browserSync.js)  510ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 21%
   4  [524]  browser-sync (node_modules/browser-sync/index.js)                         348ms  ▇▇▇▇▇▇▇▇▇▇▇ 15%
   5  [520]  ./lib/browser-sync (node_modules/browser-sync/lib/browser-sync.js)        345ms  ▇▇▇▇▇▇▇▇▇▇▇ 14%
   6 [2764]  /Users/xxxxxxx/xxxxxxxxxxxxxxxxxxxx...sks/karma.js (gulp/tasks/karma.js)  290ms  ▇▇▇▇▇▇▇▇▇ 12%
   7 [2763]  karma (node_modules/karma/lib/index.js)                                   289ms  ▇▇▇▇▇▇▇▇▇ 12%
@jasnell
Copy link
Member

jasnell commented Jun 4, 2015

@elijahwww ... in order to diagnose this properly, it would be helpful to have a simple test case that reliably reproduces the problem. Otherwise, it's going to be difficult to say whether or not it's a problem in node specifically vs. an issue in gulp or the modules being loaded via the require.

@elijahiuu
Copy link
Author

I will work on getting that procured.

@Trott Trott closed this as completed Apr 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants