Any ways to reduce Meteor reload times in development?

If this github issue is any indication we’re not alone in seeing pretty terrible load and re-load times on Meteor 1.3.2.4. There’s seems to be a huge number of files copied on every package change and babel compilation is also very time consuming.

Would love to hear of any tricks we can use to improve things.

For reference here’s a profile of what we’re seeing on a very simple application:

| (#5) Profiling: ProjectContext prepareProjectForBuild
| Building package ui-package /
| ProjectContext prepareProjectForBuild…12,891 ms (1)
| └─ _buildLocalPackages…12,674 ms (1)
| └─ IsopackCache Build local isopack…12,669 ms (5)
| └─ Isopack#saveToPath…12,475 ms (1)
| ├─ Builder#copyDirectory…9,180 ms (2)
| │ ├─ Builder#_ensureDirectory…329 ms (1740)
| │ │ └─ files.mkdir 258 ms (1738)
| │ ├─ files.readdir 219 ms (1740)
| │ ├─ files.lstat 2,138 ms (14916)
| │ ├─ files.copyFile…4,834 ms (13160)
| │ │ ├─ files.stat 293 ms (13160)
| │ │ └─ other files.copyFile 4,541 ms
| │ └─ other Builder#copyDirectory 1,656 ms
| └─ Builder#complete…3,252 ms (1)
| └─ files.renameDirAlmostAtomically…3,252 ms (1)
| └─ files.rm_recursive 3,252 ms (1)
|
| Top leaves:
| other files.copyFile…4,541 ms (13160)
| files.rm_recursive…3,253 ms (3)
| files.lstat…2,143 ms (14954)
| other Builder#copyDirectory…1,656 ms (2)
| files.stat…305 ms (14150)
| files.mkdir…262 ms (1769)
| files.readdir…243 ms (1949)
| files.readFile…136 ms (712)
|
| (#5) Total: 12,891 ms (ProjectContext prepareProjectForBuild)
|
| (#6) Profiling: Rebuild App
| Building the application -
| files.readFile 3 ms (3)
| files.exists 1 ms (4)
| Rebuild App…5,139 ms (1)
| ├─ compiler.compile(the app)…2,513 ms (1)
| │ └─ compileUnibuild (the app)…2,512 ms (2)
| │ ├─ files.realpath 462 ms (2456)
| │ ├─ files.readdir 612 ms (4915)
| │ ├─ files.stat 489 ms (39777)
| │ └─ other compileUnibuild (the app) 879 ms
| ├─ bundler.bundle…makeClientTarget…1,227 ms (1)
| │ └─ Target#make…1,227 ms (1)
| │ ├─ Target#_runCompilerPlugins…364 ms (1)
| │ │ └─ plugin ecmascript 257 ms (1)
| │ └─ Target#_emitResources…804 ms (1)
| │ └─ PackageSourceBatch.computeJsOutputFilesMap…749 ms (1)
| │ ├─ ImportScanner#_tryToResolveImportedPath 378 ms (2529)
| │ └─ ImportScanner#_readFile 223 ms (754)
| ├─ bundler.bundle…makeServerTarget…856 ms (1)
| │ └─ Target#make…856 ms (1)
| │ ├─ Target#_runCompilerPlugins…498 ms (1)
| │ │ └─ plugin ecmascript 260 ms (1)
| │ └─ Target#_emitResources…342 ms (1)
| │ └─ PackageSourceBatch.computeJsOutputFilesMap 305 ms (1)
| └─ bundler writeSiteArchive…536 ms (1)
| └─ bundler writeTargetToPath…532 ms (2)
| └─ ServerTarget#write…446 ms (1)
| └─ JsImage#write…430 ms (1)
| └─ Builder#copyDirectory 277 ms (22)
|
| Top leaves:
| other compileUnibuild (the app)…879 ms (2)
| files.stat…720 ms (46241)
| files.readdir…615 ms (4938)
| files.realpath…540 ms (2634)
| files.readFile…390 ms (1586)
| Babel.compile…351 ms (368)
| other Target#_runCompilerPlugins…212 ms (2)
| files.rm_recursive…114 ms (372)
|
| (#6) Total: 5,143 ms (Rebuild App)
|

2 Likes