themeteorchef / base

A starting point for Meteor apps.
http://themeteorchef.com/base
MIT License
695 stars 253 forks source link

Current directory layout prevents faster client-side only rebuilds #183

Closed jerfowler closed 8 years ago

jerfowler commented 8 years ago

The current directory layout mixes server-side and client-side code under /imports. This requires meteor to rebuild the entire application when only a minor client-side change was made.

Refactoring the directory structure so that all client-side code resides under /client improves rebuild times from 47,307 ms down to 24,875 ms.

Pull request: #182

Default directory structure with everything under /imports and a small client-side change:

=> Started your app.

=> App running at: http://localhost:3000/
   Type Control-C twice to stop.

| (#3) Profiling: ProjectContext prepareProjectForBuild
|  Downloading missing packages              /
| ProjectContext prepareProjectForBuild...........................719 ms (1)
| ├─ _initializeCatalog............................................16 ms (1)
| │  ├─ files.readdir                                               1 ms (1)
| │  └─ other _initializeCatalog                                   15 ms
| ├─ _resolveConstraints...........................................23 ms (1)
| │  ├─ Select Package Versions.....................................7 ms (1)
| │  │  ├─ new CS.Input                                             6 ms (1)
| │  │  └─ other Select Package Versions                            1 ms
| │  ├─ files.writeFileAtomically...................................5 ms (1)
| │  │  ├─ files.writeFile                                          3 ms (1)
| │  │  └─ files.rename                                             2 ms (1)
| │  └─ other _resolveConstraints                                  10 ms
| ├─ _downloadMissingPackages.....................................661 ms (1)
| │  ├─ Isopack.readMetadataFromDirectory.........................238 ms (106)
| │  │  ├─ files.stat                                              39 ms (106)
| │  │  ├─ files.readFile                                         181 ms (106)
| │  │  └─ other Isopack.readMetadataFromDirectory                 18 ms
| │  └─ other _downloadMissingPackages                            423 ms
| ├─ _buildLocalPackages...........................................17 ms (1)
| │  ├─ IsopackCache Load local isopack.............................6 ms (106)
| │  │  ├─ Isopack#getStrongOrderedUsedAndImpliedPackages           5 ms (106)
| │  │  └─ other IsopackCache Load local isopack                    1 ms
| │  └─ other _buildLocalPackages                                  10 ms
| └─ other ProjectContext prepareProjectForBuild                    2 ms
|
| Top leaves:
| other _downloadMissingPackages.............................423 ms (1)
| files.readFile.............................................181 ms (106)
|
| (#3) Total: 719 ms (ProjectContext prepareProjectForBuild)
|
| (#4) Profiling: Rebuild App                /
|  Building the application                  \
| files.stat                                                        1 ms (3)
| files.readFile                                                    7 ms (4)
| files.writeFileAtomically.......................................800 ms (1)
| ├─ files.writeFile                                              797 ms (1)
| └─ files.rename                                                   3 ms (1)
| Rebuild App..................................................46,499 ms (1)
| └─ files.withCache...........................................46,498 ms (1)
|    ├─ initFromAppDir                                              4 ms (1)
|    ├─ compiler.compile(the app)..............................10,148 ms (1)
|    │  ├─ files.withCache.....................................10,147 ms (2)
|    │  │  └─ compileUnibuild (the app)........................10,146 ms (2)
|    │  │     ├─ Isopack#getUnibuildAtArch                          2 ms (108)
|    │  │     ├─ files.withCache..................................119 ms (2)
|    │  │     │  ├─ files.realpath                                 45 ms (32)
|    │  │     │  ├─ files.readdir                                  34 ms (64)
|    │  │     │  ├─ files.stat                                     16 ms (76)
|    │  │     │  └─ other files.withCache                          24 ms
|    │  │     ├─ files.readdir                                  1,564 ms (1471)
|    │  │     ├─ files.readFile                                 1,910 ms (504)
|    │  │     ├─ sha1                                              36 ms (212)
|    │  │     ├─ files.lstat                                    4,257 ms (7016)
|    │  │     ├─ files.stat                                       535 ms (1324)
|    │  │     └─ other compileUnibuild (the app)                1,722 ms
|    │  └─ other compiler.compile(the app)                          1 ms
|    ├─ compiler.lint(the app)......................................6 ms (1)
|    │  ├─ Isopack#getUnibuildAtArch                                2 ms (108)
|    │  └─ other compiler.lint(the app)                             4 ms
|    ├─ Isopack#getUnibuildAtArch                                   3 ms (108)
|    ├─ bundler.bundle..makeClientTarget.......................21,141 ms (1)
|    │  ├─ Target#make.........................................21,140 ms (1)
|    │  │  ├─ Isopack#getUnibuildAtArch                            21 ms (805)
|    │  │  ├─ Target#_runCompilerPlugins........................4,441 ms (1)
|    │  │  │  ├─ files.stat                                         1 ms (1)
|    │  │  │  ├─ files.realpath                                   352 ms (75)
|    │  │  │  ├─ Isopack#ensurePluginsInitialized                   1 ms (169)
|    │  │  │  ├─ sha1                                               7 ms (128)
|    │  │  │  ├─ Isopack#getUnibuildAtArch                         20 ms (785)
|    │  │  │  ├─ plugin ecmascript..............................3,402 ms (1)
|    │  │  │  │  ├─ files.stat                                    131 ms (300)
|    │  │  │  │  ├─ Babel.compile                               3,112 ms (87)
|    │  │  │  │  ├─ sha1                                            5 ms (88)
|    │  │  │  │  ├─ files.readFile                                  4 ms (1)
|    │  │  │  │  └─ other plugin ecmascript                       149 ms
|    │  │  │  ├─ plugin templating                                 39 ms (1)
|    │  │  │  ├─ plugin meteor....................................277 ms (1)
|    │  │  │  │  ├─ sha1                                           36 ms (39)
|    │  │  │  │  └─ other plugin meteor                           241 ms
|    │  │  │  ├─ plugin fourseven:scss                             30 ms (1)
|    │  │  │  ├─ plugin static-html...............................213 ms (1)
|    │  │  │  │  ├─ wrapped.fs.readFileSync                       138 ms (103)
|    │  │  │  │  └─ other plugin static-html                       75 ms
|    │  │  │  └─ other Target#_runCompilerPlugins                  99 ms
|    │  │  ├─ Target#_emitResources............................15,987 ms (1)
|    │  │  │  ├─ PackageSourceBatch.computeJsOutputFilesMap....15,707 ms (1)
|    │  │  │  │  ├─ ImportScanner#_getInstallPath                 671 ms (1862)
|    │  │  │  │  ├─ ImportScanner#_findImportedModuleIdentifiers   48 ms (1667)
|    │  │  │  │  ├─ Resolver#resolve............................6,142 ms (3540)
|    │  │  │  │  │  ├─ Resolver#_resolveAbsolute...................12 ms (1775)
|    │  │  │  │  │  │  ├─ Resolver#_joinAndStat.....................1 ms (1)
|    │  │  │  │  │  │  │  └─ files.stat                             1 ms (5)
|    │  │  │  │  │  │  └─ other Resolver#_resolveAbsolute          11 ms
|    │  │  │  │  │  ├─ Resolver#_resolveRelative................2,647 ms (1774)
|    │  │  │  │  │  │  ├─ Resolver#_joinAndStat.................2,609 ms (1564)
|    │  │  │  │  │  │  │  ├─ files.stat                         2,080 ms (3911)
|    │  │  │  │  │  │  │  └─ other Resolver#_joinAndStat          529 ms
|    │  │  │  │  │  │  └─ other Resolver#_resolveRelative          38 ms
|    │  │  │  │  │  ├─ Resolver#_resolveNodeModule..............2,344 ms (210)
|    │  │  │  │  │  │  ├─ Resolver#_joinAndStat.................2,210 ms (952)
|    │  │  │  │  │  │  │  ├─ files.stat                         1,625 ms (3072)
|    │  │  │  │  │  │  │  └─ other Resolver#_joinAndStat          585 ms
|    │  │  │  │  │  │  ├─ Resolver#resolve..........................8 ms (3)
|    │  │  │  │  │  │  │  └─ Resolver#_resolveNodeModule............8 ms (3)
|    │  │  │  │  │  │  │     └─ Resolver#_joinAndStat...............7 ms (6)
|    │  │  │  │  │  │  │        ├─ files.stat                       6 ms (18)
|    │  │  │  │  │  │  │        └─ other Resolver#_joinAndStat      1 ms
|    │  │  │  │  │  │  └─ other Resolver#_resolveNodeModule       126 ms
|    │  │  │  │  │  ├─ Resolver#_resolvePkgJsonMain...............512 ms (298)
|    │  │  │  │  │  │  ├─ Resolver#_readPkgJson...................438 ms (298)
|    │  │  │  │  │  │  │  ├─ files.readFile                       401 ms (264)
|    │  │  │  │  │  │  │  ├─ sha1                                   2 ms (30)
|    │  │  │  │  │  │  │  └─ other Resolver#_readPkgJson           35 ms
|    │  │  │  │  │  │  ├─ ImportScanner#_getInstallPath             8 ms (30)
|    │  │  │  │  │  │  ├─ sha1                                      1 ms (30)
|    │  │  │  │  │  │  ├─ Resolver#_joinAndStat....................18 ms (54)
|    │  │  │  │  │  │  │  ├─ files.stat                            12 ms (23)
|    │  │  │  │  │  │  │  └─ other Resolver#_joinAndStat            6 ms
|    │  │  │  │  │  │  └─ other Resolver#_resolvePkgJsonMain       46 ms
|    │  │  │  │  │  ├─ Resolver#_joinAndStat......................175 ms (244)
|    │  │  │  │  │  │  ├─ files.stat                              127 ms (240)
|    │  │  │  │  │  │  └─ other Resolver#_joinAndStat              48 ms
|    │  │  │  │  │  └─ other Resolver#resolve                     452 ms
|    │  │  │  │  ├─ ImportScanner#_readFile.....................7,830 ms (1596)
|    │  │  │  │  │  ├─ files.readFile                           7,504 ms (1596)
|    │  │  │  │  │  ├─ sha1                                        92 ms (1596)
|    │  │  │  │  │  └─ other ImportScanner#_readFile              234 ms
|    │  │  │  │  └─ other PackageSourceBatch.computeJsOutputFilesMap 1,016 ms
|    │  │  │  ├─ PackageSourceBatch#getResources..................260 ms (76)
|    │  │  │  │  ├─ PackageSourceBatch#_linkJS....................256 ms (76)
|    │  │  │  │  │  ├─ sha1                                         6 ms (76)
|    │  │  │  │  │  ├─ files.readFile                               5 ms (1)
|    │  │  │  │  │  ├─ linker.fullLink............................173 ms (1)
|    │  │  │  │  │  │  ├─ linker Module#getPrelinkedFiles.........169 ms (1)
|    │  │  │  │  │  │  │  ├─ linker File#getPrelinkedOutput        91 ms (28)
|    │  │  │  │  │  │  │  ├─ getPrelinkedFiles toStringWithSourceMap 70 ms (1)
|    │  │  │  │  │  │  │  └─ other linker Module#getPrelinkedFiles  8 ms
|    │  │  │  │  │  │  └─ other linker.fullLink                     4 ms
|    │  │  │  │  │  └─ other PackageSourceBatch#_linkJS            72 ms
|    │  │  │  │  └─ other PackageSourceBatch#getResources           4 ms
|    │  │  │  └─ other Target#_emitResources                       20 ms
|    │  │  ├─ Target#minifyJs                                      50 ms (1)
|    │  │  ├─ ClientTarget#minifyCss..............................502 ms (1)
|    │  │  │  ├─ mergeCss.........................................486 ms (1)
|    │  │  │  │  ├─ CssTools.parseCss                             190 ms (5)
|    │  │  │  │  ├─ CssTools.mergeCssAsts..........................74 ms (1)
|    │  │  │  │  │  ├─ CssTools.rewriteCssUrls                     72 ms (5)
|    │  │  │  │  │  └─ other CssTools.mergeCssAsts                  2 ms
|    │  │  │  │  ├─ CssTools.stringifyCss                         147 ms (1)
|    │  │  │  │  ├─ composing source maps                          58 ms (1)
|    │  │  │  │  └─ other mergeCss                                 16 ms
|    │  │  │  └─ other ClientTarget#minifyCss                      17 ms
|    │  │  ├─ Target#rewriteSourceMaps                              2 ms (1)
|    │  │  ├─ sha1                                                 91 ms (78)
|    │  │  └─ other Target#make                                    45 ms
|    │  └─ other bundler.bundle..makeClientTarget                   1 ms
|    ├─ bundler.bundle..makeServerTarget........................7,067 ms (1)
|    │  └─ Target#make..........................................7,066 ms (1)
|    │     ├─ Isopack#getUnibuildAtArch                            34 ms (912)
|    │     ├─ Target#_runCompilerPlugins........................1,145 ms (1)
|    │     │  ├─ files.realpath                                   537 ms (86)
|    │     │  ├─ Isopack#ensurePluginsInitialized                   6 ms (190)
|    │     │  ├─ sha1                                              12 ms (148)
|    │     │  ├─ Isopack#getUnibuildAtArch                         34 ms (905)
|    │     │  ├─ plugin ecmascript................................400 ms (1)
|    │     │  │  ├─ files.stat                                     94 ms (342)
|    │     │  │  ├─ Babel.compile                                 184 ms (97)
|    │     │  │  ├─ sha1                                            5 ms (98)
|    │     │  │  ├─ files.readFile                                  4 ms (1)
|    │     │  │  └─ other plugin ecmascript                       113 ms
|    │     │  └─ other Target#_runCompilerPlugins                 156 ms
|    │     ├─ Target#_emitResources.............................5,801 ms (1)
|    │     │  ├─ PackageSourceBatch.computeJsOutputFilesMap.....5,677 ms (1)
|    │     │  │  ├─ ImportScanner#_getInstallPath                 319 ms (1333)
|    │     │  │  ├─ ImportScanner#_findImportedModuleIdentifiers   21 ms (1266)
|    │     │  │  ├─ Resolver#resolve............................1,581 ms (1639)
|    │     │  │  │  ├─ Resolver#_resolveAbsolute                    5 ms (1286)
|    │     │  │  │  ├─ Resolver#_resolveRelative..................757 ms (1285)
|    │     │  │  │  │  ├─ Resolver#_joinAndStat...................737 ms (1200)
|    │     │  │  │  │  │  ├─ files.stat                           531 ms (1424)
|    │     │  │  │  │  │  └─ other Resolver#_joinAndStat          206 ms
|    │     │  │  │  │  └─ other Resolver#_resolveRelative          20 ms
|    │     │  │  │  ├─ Resolver#_resolveNodeModule................273 ms (85)
|    │     │  │  │  │  ├─ Resolver#_joinAndStat...................240 ms (310)
|    │     │  │  │  │  │  ├─ files.stat                           184 ms (551)
|    │     │  │  │  │  │  └─ other Resolver#_joinAndStat           56 ms
|    │     │  │  │  │  └─ other Resolver#_resolveNodeModule        33 ms
|    │     │  │  │  ├─ Resolver#_resolvePkgJsonMain...............353 ms (240)
|    │     │  │  │  │  ├─ Resolver#_readPkgJson...................325 ms (240)
|    │     │  │  │  │  │  ├─ files.readFile                       307 ms (240)
|    │     │  │  │  │  │  ├─ sha1                                   1 ms (9)
|    │     │  │  │  │  │  └─ other Resolver#_readPkgJson           17 ms
|    │     │  │  │  │  ├─ ImportScanner#_getInstallPath             1 ms (9)
|    │     │  │  │  │  ├─ Resolver#_joinAndStat.....................7 ms (9)
|    │     │  │  │  │  │  ├─ files.stat                             5 ms (11)
|    │     │  │  │  │  │  └─ other Resolver#_joinAndStat            2 ms
|    │     │  │  │  │  └─ other Resolver#_resolvePkgJsonMain       20 ms
|    │     │  │  │  ├─ Resolver#_joinAndStat                       26 ms (231)
|    │     │  │  │  └─ other Resolver#resolve                     167 ms
|    │     │  │  ├─ ImportScanner#_readFile.....................3,300 ms (1208)
|    │     │  │  │  ├─ files.readFile                           3,147 ms (1208)
|    │     │  │  │  ├─ sha1                                        42 ms (1208)
|    │     │  │  │  └─ other ImportScanner#_readFile              111 ms
|    │     │  │  └─ other PackageSourceBatch.computeJsOutputFilesMap 455 ms
|    │     │  ├─ PackageSourceBatch#getResources...................94 ms (87)
|    │     │  │  ├─ PackageSourceBatch#_linkJS.....................85 ms (87)
|    │     │  │  │  ├─ sha1                                         9 ms (87)
|    │     │  │  │  └─ other PackageSourceBatch#_linkJS            76 ms
|    │     │  │  └─ other PackageSourceBatch#getResources           8 ms
|    │     │  └─ other Target#_emitResources                       30 ms
|    │     ├─ Target#rewriteSourceMaps                              6 ms (1)
|    │     └─ other Target#make                                    81 ms
|    ├─ bundler writeSiteArchive................................8,105 ms (1)
|    │  ├─ files.rm_recursive                                      19 ms (1)
|    │  ├─ files.stat                                               1 ms (3)
|    │  ├─ files.mkdir                                              3 ms (1)
|    │  ├─ Builder#write...........................................85 ms (4)
|    │  │  ├─ Builder#_ensureDirectory..............................3 ms (4)
|    │  │  │  ├─ files.mkdir                                        2 ms (1)
|    │  │  │  └─ other Builder#_ensureDirectory                     1 ms
|    │  │  ├─ files.readFile                                       11 ms (2)
|    │  │  ├─ files.writeFile                                      42 ms (4)
|    │  │  ├─ files.rename                                         23 ms (4)
|    │  │  └─ other Builder#write                                   6 ms
|    │  ├─ bundler writeTargetToPath............................7,674 ms (2)
|    │  │  ├─ files.rm_recursive                                   12 ms (2)
|    │  │  ├─ files.stat                                            3 ms (6)
|    │  │  ├─ files.mkdir                                           9 ms (3)
|    │  │  ├─ ClientTarget#write................................3,136 ms (1)
|    │  │  │  ├─ files.mkdir                                       19 ms (5)
|    │  │  │  ├─ Builder#write..................................1,068 ms (59)
|    │  │  │  │  ├─ Builder#_ensureDirectory                        2 ms (59)
|    │  │  │  │  ├─ sha1                                           49 ms (59)
|    │  │  │  │  ├─ files.writeFile                               686 ms (59)
|    │  │  │  │  ├─ files.rename                                  306 ms (59)
|    │  │  │  │  └─ other Builder#write                            25 ms
|    │  │  │  ├─ bundler writeFile..............................1,582 ms (86)
|    │  │  │  │  ├─ Builder#write...............................1,577 ms (86)
|    │  │  │  │  │  ├─ Builder#_ensureDirectory                     5 ms (86)
|    │  │  │  │  │  ├─ files.writeFile                          1,073 ms (86)
|    │  │  │  │  │  ├─ files.rename                               458 ms (86)
|    │  │  │  │  │  └─ other Builder#write                         41 ms
|    │  │  │  │  └─ other bundler writeFile                         5 ms
|    │  │  │  ├─ sha1                                               3 ms (8)
|    │  │  │  ├─ files.writeFile                                    5 ms (1)
|    │  │  │  ├─ files.rename                                       2 ms (1)
|    │  │  │  └─ other ClientTarget#write                         457 ms
|    │  │  ├─ Builder#complete....................................161 ms (2)
|    │  │  │  └─ files.renameDirAlmostAtomically..................161 ms (2)
|    │  │  │     └─ files.rename                                  160 ms (4)
|    │  │  ├─ ServerTarget#write................................4,348 ms (1)
|    │  │  │  ├─ files.writeFile                                    5 ms (1)
|    │  │  │  ├─ files.rename                                       2 ms (1)
|    │  │  │  ├─ files.readFile                                     1 ms (1)
|    │  │  │  ├─ Builder#write.....................................85 ms (10)
|    │  │  │  │  ├─ files.writeFile                                34 ms (10)
|    │  │  │  │  ├─ files.rename                                   19 ms (10)
|    │  │  │  │  ├─ files.readFile                                 26 ms (18)
|    │  │  │  │  └─ other Builder#write                             4 ms
|    │  │  │  ├─ JsImage#write..................................4,192 ms (1)
|    │  │  │  │  ├─ files.mkdir                                    11 ms (5)
|    │  │  │  │  ├─ Builder#write...............................1,824 ms (159)
|    │  │  │  │  │  ├─ Builder#_ensureDirectory                     5 ms (159)
|    │  │  │  │  │  ├─ sha1                                        38 ms (159)
|    │  │  │  │  │  ├─ files.writeFile                          1,227 ms (159)
|    │  │  │  │  │  ├─ files.rename                               510 ms (159)
|    │  │  │  │  │  └─ other Builder#write                         45 ms
|    │  │  │  │  ├─ files.lstat                                   239 ms (249)
|    │  │  │  │  ├─ files.stat                                    242 ms (827)
|    │  │  │  │  ├─ files.readdir                                 520 ms (753)
|    │  │  │  │  ├─ files.readFile                                709 ms (367)
|    │  │  │  │  ├─ files.writeFile                                 2 ms (1)
|    │  │  │  │  ├─ files.rename                                    2 ms (1)
|    │  │  │  │  └─ other JsImage#write                           643 ms
|    │  │  │  └─ other ServerTarget#write                          63 ms
|    │  │  └─ other bundler writeTargetToPath                       5 ms
|    │  ├─ files.writeFile                                          8 ms (1)
|    │  ├─ files.rename                                             2 ms (1)
|    │  ├─ Builder#complete.......................................286 ms (1)
|    │  │  └─ files.renameDirAlmostAtomically.....................286 ms (1)
|    │  │     ├─ files.rename                                     106 ms (2)
|    │  │     └─ files.rm_recursive                               180 ms (1)
|    │  └─ other bundler writeSiteArchive                          27 ms
|    └─ other files.withCache                                      25 ms
|
| Top leaves:
| files.readFile..........................................14,036 ms (4207)
| files.stat...............................................5,598 ms (12141)
| files.lstat..............................................4,496 ms (7265)
| files.writeFile..........................................3,878 ms (323)
| Babel.compile............................................3,297 ms (184)
| files.readdir............................................2,118 ms (2288)
| other compileUnibuild (the app)..........................1,722 ms (2)
| files.rename.............................................1,593 ms (329)
| other PackageSourceBatch.computeJsOutputFilesMap.........1,472 ms (2)
| other Resolver#_joinAndStat..............................1,431 ms (4340)
| ImportScanner#_getInstallPath..............................999 ms (3234)
| files.realpath.............................................934 ms (194)
| other JsImage#write........................................643 ms (1)
| other Resolver#resolve.....................................619 ms (5182)
| other ClientTarget#write...................................457 ms (1)
| sha1.......................................................438 ms (4113)
| other ImportScanner#_readFile..............................345 ms (2804)
| other plugin ecmascript....................................262 ms (2)
| other Target#_runCompilerPlugins...........................255 ms (2)
| other plugin meteor........................................241 ms (1)
| files.rm_recursive.........................................212 ms (4)
| CssTools.parseCss..........................................190 ms (5)
| other Resolver#_resolveNodeModule..........................159 ms (298)
| other PackageSourceBatch#_linkJS...........................148 ms (163)
| CssTools.stringifyCss......................................147 ms (1)
| wrapped.fs.readFileSync....................................138 ms (103)
| other Target#make..........................................126 ms (2)
| other Builder#write........................................121 ms (318)
| Isopack#getUnibuildAtArch..................................116 ms (3731)
|
| (#4) Total: 47,307 ms (Rebuild App)
|

After refactoring the code and under /client and a small client-side change:

=> Started your app.

=> App running at: http://localhost:3000/
   Type Control-C twice to stop.

| (#3) Profiling: ProjectContext prepareProjectForBuild
|
| ProjectContext prepareProjectForBuild...........................318 ms (1)
| ├─ _initializeCatalog                                             4 ms (1)
| ├─ _resolveConstraints...........................................18 ms (1)
| │  ├─ Select Package Versions.....................................9 ms (1)
| │  │  ├─ new CS.Input                                             6 ms (1)
| │  │  └─ other Select Package Versions                            3 ms
| │  ├─ files.writeFileAtomically...................................5 ms (1)
| │  │  ├─ files.writeFile                                          3 ms (1)
| │  │  └─ files.rename                                             2 ms (1)
| │  └─ other _resolveConstraints                                   4 ms
| ├─ _downloadMissingPackages.....................................281 ms (1)
| │  ├─ Isopack.readMetadataFromDirectory.........................232 ms (106)
| │  │  ├─ files.stat                                              32 ms (106)
| │  │  ├─ files.readFile                                         187 ms (106)
| │  │  └─ other Isopack.readMetadataFromDirectory                 14 ms
| │  └─ other _downloadMissingPackages                             49 ms
| └─ _buildLocalPackages...........................................13 ms (1)
|    ├─ IsopackCache Load local isopack.............................6 ms (106)
|    │  ├─ Isopack#getStrongOrderedUsedAndImpliedPackages           5 ms (106)
|    │  └─ other IsopackCache Load local isopack                    1 ms
|    └─ other _buildLocalPackages                                   7 ms
|
| Top leaves:
| files.readFile.............................................187 ms (106)
|
| (#3) Total: 318 ms (ProjectContext prepareProjectForBuild)
|
| (#4) Profiling: Rebuild App
|
| files.stat                                                        1 ms (3)
| files.readFile                                                    7 ms (4)
| files.writeFileAtomically.......................................300 ms (1)
| ├─ files.writeFile                                              298 ms (1)
| └─ files.rename                                                   2 ms (1)
| Rebuild App..................................................24,566 ms (1)
| └─ files.withCache...........................................24,566 ms (1)
|    ├─ initFromAppDir                                              2 ms (1)
|    ├─ compiler.compile(the app)...............................8,457 ms (1)
|    │  ├─ files.withCache......................................8,455 ms (2)
|    │  │  └─ compileUnibuild (the app).........................8,455 ms (2)
|    │  │     ├─ Isopack#getUnibuildAtArch                          2 ms (108)
|    │  │     ├─ files.withCache..................................192 ms (2)
|    │  │     │  ├─ files.realpath                                 45 ms (26)
|    │  │     │  ├─ files.readdir                                 111 ms (52)
|    │  │     │  ├─ files.stat                                     14 ms (75)
|    │  │     │  └─ other files.withCache                          22 ms
|    │  │     ├─ files.readdir                                  1,218 ms (1471)
|    │  │     ├─ files.readFile                                 1,030 ms (487)
|    │  │     ├─ sha1                                              13 ms (195)
|    │  │     ├─ files.lstat                                    4,614 ms (7016)
|    │  │     ├─ files.stat                                       306 ms (1324)
|    │  │     └─ other compileUnibuild (the app)                1,079 ms
|    │  └─ other compiler.compile(the app)                          2 ms
|    ├─ compiler.lint(the app)......................................4 ms (1)
|    │  ├─ Isopack#getUnibuildAtArch                                1 ms (108)
|    │  └─ other compiler.lint(the app)                             2 ms
|    ├─ Isopack#getUnibuildAtArch                                   1 ms (108)
|    ├─ bundler.bundle..makeClientTarget.......................12,378 ms (1)
|    │  └─ Target#make.........................................12,378 ms (1)
|    │     ├─ Isopack#getUnibuildAtArch                             8 ms (805)
|    │     ├─ Target#_runCompilerPlugins..........................926 ms (1)
|    │     │  ├─ files.realpath                                   323 ms (75)
|    │     │  ├─ sha1                                               4 ms (128)
|    │     │  ├─ Isopack#getUnibuildAtArch                         12 ms (785)
|    │     │  ├─ plugin ecmascript................................269 ms (1)
|    │     │  │  ├─ files.stat                                     54 ms (296)
|    │     │  │  ├─ Babel.compile                                 134 ms (87)
|    │     │  │  ├─ sha1                                            4 ms (88)
|    │     │  │  └─ other plugin ecmascript                        76 ms
|    │     │  ├─ plugin templating                                  4 ms (1)
|    │     │  ├─ plugin meteor.....................................67 ms (1)
|    │     │  │  ├─ sha1                                           13 ms (39)
|    │     │  │  └─ other plugin meteor                            54 ms
|    │     │  ├─ plugin fourseven:scss                              4 ms (1)
|    │     │  ├─ plugin static-html...............................181 ms (1)
|    │     │  │  ├─ wrapped.fs.readFileSync                       146 ms (103)
|    │     │  │  └─ other plugin static-html                       35 ms
|    │     │  └─ other Target#_runCompilerPlugins                  61 ms
|    │     ├─ Target#_emitResources............................11,232 ms (1)
|    │     │  ├─ PackageSourceBatch.computeJsOutputFilesMap....11,150 ms (1)
|    │     │  │  ├─ ImportScanner#_getInstallPath                 333 ms (1862)
|    │     │  │  ├─ ImportScanner#_findImportedModuleIdentifiers   27 ms (1667)
|    │     │  │  ├─ Resolver#resolve............................2,997 ms (3575)
|    │     │  │  │  ├─ Resolver#_resolveAbsolute                    5 ms (1775)
|    │     │  │  │  ├─ Resolver#_resolveRelative................1,410 ms (1769)
|    │     │  │  │  │  ├─ Resolver#_joinAndStat.................1,392 ms (1559)
|    │     │  │  │  │  │  ├─ files.stat                         1,127 ms (3912)
|    │     │  │  │  │  │  └─ other Resolver#_joinAndStat          266 ms
|    │     │  │  │  │  └─ other Resolver#_resolveRelative          17 ms
|    │     │  │  │  ├─ Resolver#_resolveNodeModule................932 ms (210)
|    │     │  │  │  │  ├─ Resolver#_joinAndStat...................884 ms (946)
|    │     │  │  │  │  │  ├─ files.stat                           736 ms (3036)
|    │     │  │  │  │  │  └─ other Resolver#_joinAndStat          149 ms
|    │     │  │  │  │  ├─ Resolver#resolve..........................4 ms (3)
|    │     │  │  │  │  │  └─ Resolver#_resolveNodeModule............4 ms (3)
|    │     │  │  │  │  │     └─ Resolver#_joinAndStat...............4 ms (6)
|    │     │  │  │  │  │        └─ files.stat                       3 ms (18)
|    │     │  │  │  │  └─ other Resolver#_resolveNodeModule        44 ms
|    │     │  │  │  ├─ Resolver#_resolvePkgJsonMain...............347 ms (298)
|    │     │  │  │  │  ├─ Resolver#_readPkgJson...................313 ms (298)
|    │     │  │  │  │  │  ├─ files.readFile                       295 ms (264)
|    │     │  │  │  │  │  └─ other Resolver#_readPkgJson           17 ms
|    │     │  │  │  │  ├─ ImportScanner#_getInstallPath             3 ms (30)
|    │     │  │  │  │  ├─ Resolver#_joinAndStat.....................8 ms (54)
|    │     │  │  │  │  │  ├─ files.stat                             6 ms (23)
|    │     │  │  │  │  │  └─ other Resolver#_joinAndStat            2 ms
|    │     │  │  │  │  └─ other Resolver#_resolvePkgJsonMain       23 ms
|    │     │  │  │  ├─ Resolver#_joinAndStat.......................94 ms (244)
|    │     │  │  │  │  ├─ files.stat                               69 ms (240)
|    │     │  │  │  │  └─ other Resolver#_joinAndStat              25 ms
|    │     │  │  │  └─ other Resolver#resolve                     209 ms
|    │     │  │  ├─ ImportScanner#_readFile.....................7,302 ms (1596)
|    │     │  │  │  ├─ files.readFile                           7,135 ms (1596)
|    │     │  │  │  ├─ sha1                                        50 ms (1596)
|    │     │  │  │  └─ other ImportScanner#_readFile              117 ms
|    │     │  │  └─ other PackageSourceBatch.computeJsOutputFilesMap 490 ms
|    │     │  ├─ PackageSourceBatch#getResources...................75 ms (76)
|    │     │  │  ├─ PackageSourceBatch#_linkJS.....................74 ms (76)
|    │     │  │  │  ├─ sha1                                         2 ms (76)
|    │     │  │  │  ├─ linker.fullLink.............................49 ms (1)
|    │     │  │  │  │  ├─ linker Module#getPrelinkedFiles..........47 ms (1)
|    │     │  │  │  │  │  ├─ linker File#getPrelinkedOutput        23 ms (28)
|    │     │  │  │  │  │  ├─ getPrelinkedFiles toStringWithSourceMap 21 ms (1)
|    │     │  │  │  │  │  └─ other linker Module#getPrelinkedFiles  3 ms
|    │     │  │  │  │  └─ other linker.fullLink                     2 ms
|    │     │  │  │  └─ other PackageSourceBatch#_linkJS            23 ms
|    │     │  │  └─ other PackageSourceBatch#getResources           1 ms
|    │     │  └─ other Target#_emitResources                        7 ms
|    │     ├─ Target#minifyJs                                      26 ms (1)
|    │     ├─ ClientTarget#minifyCss..............................138 ms (1)
|    │     │  ├─ mergeCss.........................................133 ms (1)
|    │     │  │  ├─ CssTools.parseCss                              52 ms (5)
|    │     │  │  ├─ CssTools.mergeCssAsts..........................15 ms (1)
|    │     │  │  │  ├─ CssTools.rewriteCssUrls                     14 ms (5)
|    │     │  │  │  └─ other CssTools.mergeCssAsts                  1 ms
|    │     │  │  ├─ CssTools.stringifyCss                          25 ms (1)
|    │     │  │  ├─ composing source maps                          32 ms (1)
|    │     │  │  └─ other mergeCss                                  9 ms
|    │     │  └─ other ClientTarget#minifyCss                       5 ms
|    │     ├─ sha1                                                 35 ms (78)
|    │     └─ other Target#make                                    12 ms
|    ├─ bundler writeTargetToPath...............................3,714 ms (1)
|    │  ├─ files.rm_recursive                                      14 ms (1)
|    │  ├─ files.stat                                               1 ms (3)
|    │  ├─ files.mkdir                                             74 ms (1)
|    │  ├─ ClientTarget#write...................................1,607 ms (1)
|    │  │  ├─ files.mkdir                                           5 ms (5)
|    │  │  ├─ Builder#write.......................................577 ms (59)
|    │  │  │  ├─ Builder#_ensureDirectory                           2 ms (59)
|    │  │  │  ├─ sha1                                              16 ms (59)
|    │  │  │  ├─ files.writeFile                                  385 ms (59)
|    │  │  │  ├─ files.rename                                     158 ms (59)
|    │  │  │  └─ other Builder#write                               16 ms
|    │  │  ├─ bundler writeFile...................................735 ms (86)
|    │  │  │  ├─ Builder#write....................................732 ms (86)
|    │  │  │  │  ├─ Builder#_ensureDirectory                        3 ms (86)
|    │  │  │  │  ├─ files.writeFile                               518 ms (86)
|    │  │  │  │  ├─ files.rename                                  189 ms (86)
|    │  │  │  │  └─ other Builder#write                            22 ms
|    │  │  │  └─ other bundler writeFile                            3 ms
|    │  │  ├─ sha1                                                  2 ms (8)
|    │  │  ├─ files.writeFile                                       2 ms (1)
|    │  │  ├─ files.rename                                          1 ms (1)
|    │  │  └─ other ClientTarget#write                            285 ms
|    │  ├─ Builder#complete.....................................2,015 ms (1)
|    │  │  └─ files.renameDirAlmostAtomically...................2,015 ms (1)
|    │  │     ├─ files.rename                                      81 ms (11)
|    │  │     ├─ files.stat                                        60 ms (163)
|    │  │     ├─ files.mkdir                                        7 ms (6)
|    │  │     ├─ files.readdir                                      6 ms (6)
|    │  │     ├─ files.rm_recursive                               435 ms (2)
|    │  │     └─ other files.renameDirAlmostAtomically          1,426 ms
|    │  └─ other bundler writeTargetToPath                          2 ms
|    └─ other files.withCache                                      10 ms
|
| Top leaves:
| files.readFile...........................................8,468 ms (2353)
| files.lstat..............................................4,614 ms (7016)
| files.stat...............................................2,378 ms (9098)
| other files.renameDirAlmostAtomically....................1,426 ms (1)
| files.readdir............................................1,335 ms (1529)
| files.writeFile..........................................1,204 ms (147)
| other compileUnibuild (the app)..........................1,079 ms (2)
| other PackageSourceBatch.computeJsOutputFilesMap...........490 ms (1)
| files.rm_recursive.........................................449 ms (3)
| other Resolver#_joinAndStat................................442 ms (2809)
| files.rename...............................................431 ms (158)
| files.realpath.............................................368 ms (102)
| ImportScanner#_getInstallPath..............................336 ms (1892)
| other ClientTarget#write...................................285 ms (1)
| other Resolver#resolve.....................................210 ms (3578)
| wrapped.fs.readFileSync....................................146 ms (103)
| sha1.......................................................141 ms (2341)
| Babel.compile..............................................134 ms (87)
| other ImportScanner#_readFile..............................117 ms (1596)
|
| (#4) Total: 24,875 ms (Rebuild App)
|
=> Client modified -- refreshing
themeteorchef commented 8 years ago

This appears to be resolved with the latest 1.4.2 release (much faster build times). I'll keep an eye on this, though. I want to avoid major restructuring as much as possible. Also want to keep this kit inline with the Meteor Guide which recommends the /imports approach. Going to close this out for now but will revisit if it seems like build times start creeping up again :)