Hi, I have extremely long rebuild times, around 30 sec with server start.
Co…nfiguration:
SSD, 16GB RAM, i7, Win 10, meteor 1.8+
Running meteor by:
```
npx cross-env METEOR_PROFILE=1000 METEOR_DISABLE_OPTIMISTIC_CACHING=1 TOOL_NODE_FLAGS=\"--max-old-space-size=10240\" meteor run
```
The project is fairly big and it will grow, where can I look for some space for optimization, please? Or is something here wrong? What is striking me is `require("/theProject/node_modules/react-dom/index.js") 2,595 ms` this seems like something wrong. So, where can I start?
Thanks
```
| (#12) Profiling: ProjectContext prepareProjectForBuild
| Downloading missing packages -
| ProjectContext prepareProjectForBuild 280 ms (1)
|
| Top leaves:
|
| (#12) Total: 280 ms (ProjectContext prepareProjectForBuild)
|
| (#13) Profiling: Rebuild App -
| |
| Rebuild App..................................................28,367 ms (1)
| └─ bundler.bundle............................................28,367 ms (1)
| ├─ compiler.compile(the app)..............................12,907 ms (1)
| │ └─ compileUnibuild (the app)...........................12,903 ms (3)
| │ ├─ files.stat 1,929 ms (7600)
| │ ├─ files.realpath 1,248 ms (581)
| │ ├─ optimistic hashOrNull.............................3,969 ms (7893)
| │ │ └─ optimistic readFile............................3,133 ms (7893)
| │ │ └─ files.readFile 3,083 ms (7893)
| │ ├─ optimistic readFile...............................3,025 ms (7893)
| │ │ └─ files.readFile 2,973 ms (7893)
| │ └─ other compileUnibuild (the app) 2,069 ms
| ├─ bundler.bundle..makeClientTarget........................4,034 ms (1)
| │ └─ Target#make..........................................4,034 ms (1)
| │ └─ Target#_emitResources.............................3,835 ms (1)
| │ └─ PackageSourceBatch.computeJsOutputFilesMap.....3,620 ms (1)
| │ └─ ImportScanner#scanImports for the app 2,500 ms (1)
| ├─ bundler.bundle..makeServerTarget........................1,312 ms (1)
| │ └─ Target#make..........................................1,311 ms (1)
| │ └─ Target#_emitResources.............................1,250 ms (1)
| │ └─ PackageSourceBatch.computeJsOutputFilesMap 1,043 ms (1)
| └─ bundler writeSiteArchive...............................10,080 ms (1)
| └─ bundler writeTargetToPath............................9,736 ms (2)
| ├─ ClientTarget#write................................3,295 ms (1)
| │ ├─ bundler writeFile..............................1,442 ms (429)
| │ │ └─ Builder#write...............................1,215 ms (429)
| │ │ └─ files.writeFile 1,159 ms (429)
| │ └─ Builder#write..................................1,197 ms (392)
| │ └─ files.writeFile 1,140 ms (392)
| └─ ServerTarget#write................................5,980 ms (1)
| └─ JsImage#write..................................5,782 ms (1)
| ├─ Builder#write 1,021 ms (4342)
| ├─ sha1 1,308 ms (13962)
| ├─ Builder#copyNodeModulesDirectory 1,543 ms (34)
| └─ other JsImage#write 1,906 ms
|
| Top leaves:
| files.readFile...........................................7,841 ms (19343)
| files.stat...............................................3,574 ms (13593)
| sha1.....................................................2,483 ms (31158)
| files.writeFile..........................................2,355 ms (829)
| other compileUnibuild (the app)..........................2,069 ms (3)
| other JsImage#write......................................1,906 ms (1)
| files.realpath...........................................1,423 ms (880)
| files.lstat................................................712 ms (7371)
| Babel.compile..............................................681 ms (347)
| files.rename...............................................408 ms (10)
| Builder#_ensureDirectory...................................353 ms (5898)
| other ClientTarget#write...................................307 ms (1)
| other bundler writeSiteArchive.............................307 ms (1)
| files.readdir..............................................259 ms (1108)
| other bundler writeFile....................................226 ms (429)
| other Target#_emitResources................................193 ms (2)
| other optimistic hashOrNull................................118 ms (7893)
| getPrelinkedFiles toStringWithSourceMap....................112 ms (2)
| files.mkdir................................................110 ms (113)
| other optimistic readFile..................................102 ms (15786)
| other ServerTarget#write...................................101 ms (1)
| other PackageSourceBatch.computeJsOutputFilesMap...........101 ms (1)
|
| (#13) Total: 28,367 ms (Rebuild App)
|
I20200120-13:43:24.759(1)? | (#1) Profiling: Server startup
W20200120-13:43:33.100(1)? (STDERR) Note: you are using a pure-JavaScript implementation of bcrypt.
W20200120-13:43:33.274(1)? (STDERR) While this implementation will work correctly, it is known to be
W20200120-13:43:33.412(1)? (STDERR) approximately three times slower than the native implementation.
W20200120-13:43:33.600(1)? (STDERR) In order to use the native implementation instead, run
W20200120-13:43:33.835(1)? (STDERR)
W20200120-13:43:33.977(1)? (STDERR) meteor npm install --save bcrypt
W20200120-13:43:34.450(1)? (STDERR)
W20200120-13:43:34.750(1)? (STDERR) in the root directory of your application.
I20200120-13:43:43.664(1)? Publishing User.User.RetrieveAll
I20200120-13:43:43.719(1)? Publishing User.User.RetrieveAll
I20200120-13:43:43.756(1)? Ignoring duplicate publish named 'User.User.RetrieveAll'
I20200120-13:43:43.786(1)? Ignoring duplicate publish named 'User.User.RetrieveAll.Count'
I20200120-13:43:43.809(1)? Asset handler: /App/Modules/User/server.js
I20200120-13:43:44.317(1)? Asset handler: /App/server.js
I20200120-13:43:44.545(1)? Server started at 13:43:44
I20200120-13:43:44.553(1)? |
I20200120-13:43:44.555(1)? | Server startup...............................................19,935 ms (1)
I20200120-13:43:44.557(1)? | └─ Load server bundles.......................................19,794 ms (1)
I20200120-13:43:44.563(1)? | ├─ packages/webapp.js......................................1,013 ms (1)
I20200120-13:43:44.570(1)? | │ └─ require("/node_modules/meteor/webapp/webapp_server.js") 1,012 ms (1)
I20200120-13:43:44.574(1)? | ├─ packages/aldeed_collection2.js..........................1,187 ms (1)
I20200120-13:43:44.579(1)? | │ └─ require("/node_modules/meteor/aldeed:collection2/collection2.js").1,186 ms (1)
I20200120-13:43:44.581(1)? | │ └─ require("simpl-schema") 1,154 ms (1)
I20200120-13:43:44.586(1)? | ├─ packages/ostrio_files.js................................4,155 ms (1)
I20200120-13:43:44.592(1)? | │ └─ require("/node_modules/meteor/ostrio:files/server.js").4,155 ms (1)
I20200120-13:43:44.596(1)? | │ └─ require("/node_modules/meteor/ostrio:files/node_modules/request/index.js") 3,607 ms (1)
I20200120-13:43:44.603(1)? | ├─ app/app.js..............................................6,527 ms (1)
I20200120-13:43:44.607(1)? | │ └─ require("/theProject/init.js")............................6,525 ms (1)
I20200120-13:43:44.612(1)? | │ ├─ require("/node_modules/uniforms-bridge-simple-schema-2/index.js") 1,181 ms (1)
I20200120-13:43:44.617(1)? | │ └─ require("/theProject/System/server.js")................5,344 ms (1)
I20200120-13:43:44.620(1)? | │ └─ require("/App/server.js")......................5,341 ms (1)
I20200120-13:43:44.626(1)? | │ └─ require("/App/Modules/User/server.js")......5,016 ms (1)
I20200120-13:43:44.629(1)? | │ └─ require("/App/Modules/User/User.Class.js").4,691 ms (1)
I20200120-13:43:44.638(1)? | │ └─ require("/App/index.js")..............3,783 ms (2)
I20200120-13:43:44.642(1)? | │ └─ require("/App/App.js").............2,937 ms (1)
I20200120-13:43:44.649(1)? | │ └─ require("/theProject/index.js")......2,930 ms (1)
I20200120-13:43:44.654(1)? | │ └─ require("/theProject/System/ClientRunner.js").2,621 ms (1)
I20200120-13:43:44.661(1)? | │ └─ require("/theProject/node_modules/react-dom/index.js") 2,595 ms (1)
I20200120-13:43:44.670(1)? | └─ other Load server bundles 1,112 ms
I20200120-13:43:44.696(1)? |
I20200120-13:43:44.736(1)? | Top leaves:
I20200120-13:43:44.824(1)? | require("/node_modules/meteor/ostrio:files/node_modules/request/index.js").3,607 ms (1)
I20200120-13:43:44.839(1)? | require("/theProject/node_modules/react-dom/index.js")........2,595 ms (1)
I20200120-13:43:44.841(1)? | require("/node_modules/uniforms-bridge-simple-schema-2/index.js").1,181 ms (1)
I20200120-13:43:44.847(1)? | require("simpl-schema")..................................1,154 ms (1)
I20200120-13:43:44.853(1)? | other Load server bundles................................1,112 ms (1)
I20200120-13:43:44.859(1)? | Npm.require("mongodb").....................................997 ms (1)
I20200120-13:43:44.863(1)? | require("/App/Modules/User/node_modules/react-dom/server.js").882 ms (1)
I20200120-13:43:44.870(1)? | require("/node_modules/styled-components/dist/styled-components.cjs.js").838 ms (2)
I20200120-13:43:44.872(1)? | require("node-fetch")......................................564 ms (1)
I20200120-13:43:44.876(1)? | require("/node_modules/meteor/ostrio:loggerfile/node_modules/fs-extra/lib/index.js").527 ms (1)
I20200120-13:43:44.884(1)? | Npm.require("sockjs")......................................466 ms (1)
I20200120-13:43:44.888(1)? | require("/node_modules/meteor/ostrio:files/node_modules/fs-extra/lib/index.js").454 ms (2)
I20200120-13:43:44.894(1)? | require("reify/lib/runtime")...............................436 ms (1)
I20200120-13:43:44.896(1)? | require("/node_modules/react/index.js")....................427 ms (25)
I20200120-13:43:44.906(1)? | Npm.require("node4mailer").................................327 ms (2)
I20200120-13:43:44.910(1)? | other require("/App/Modules/User/server.js")...............325 ms (1)
I20200120-13:43:44.921(1)? | require("/node_modules/react-dom/server.js")...............308 ms (1)
I20200120-13:43:44.923(1)? | require("/node_modules/meteor/boilerplate-generator/node_modules/combined-stream2/index.js").218 ms (1)
I20200120-13:43:44.929(1)? | require("core-js/modules/es.symbol.async-iterator")........165 ms (1)
I20200120-13:43:44.940(1)? | require("/node_modules/meteor/webapp/node_modules/send/index.js").120 ms (1)
I20200120-13:43:44.942(1)? |
I20200120-13:43:44.946(1)? | (#1) Total: 19,935 ms (Server startup)
I20200120-13:43:44.955(1)? |
=> Meteor server restarted
=> Finished delayed build of web.browser.legacy in 13094ms```