Hello, just sent by private message
In my case with the exception of react-compiler and to lesser degree the styled-components babel plugins, the rest I can do without. For Storybook there is either Webpack or Vite, so moving to either of them (preferably Vite) would make my setup easier.
Sent profile on Slack DM
Interestingly, when running meteor profile instead of meteor run, the plugin cache for refapp:meteor-typescript does not seem enabled. Is that by design? If so, is there a way to re-enable it to get a profile for when caches ARE available?
Just a suggestion: if you have an app without mainModule
set, Meteor generates a single file with all of the eager imports anyway – it’ll be visible in your browser’s devtools. What we did a couple of years back was copy this file verbatim (of course we replaced the reified require
s into import
s) into client.ts
and made it the mainModule
. Then you can do the same on the server – it should be easy to find with --inspect-brk
.
Maybe there could be a meteor generate-main-module
command to do that automatically?
When I run the profiler, one of my files is getting altered to have a console.log('new line')
added to the same line as an import which breaks the compile step.
console.log(‘new line’) appears nowhere in my own code, my version control has no uncommitted changes when I start the process and has that change at the end of the process. This only occurs when profiling and not when running normally.
Yes, that’s the part of the process that simulates a rebuild by temporarily adding and then removing a line. I wouldn’t expect it to break compilation as in your case; it’s meant to be a simple addition. Perhaps this is an edge case. What OS are you using? Could you share the file contents with me privately if you’d prefer? Also, try adding a blank line in that file and running it again.
Alternatively, you could create a new “mock” file, import it from your entry point, and set its path in the METEOR_CLIENT_ENTRYPOINT
and METEOR_SERVER_ENTRYPOINT
env variables. You could also point those vars to an existing file in your code, ensuring it’s client-only for METEOR_CLIENT_ENTRYPOINT
and server-only for METEOR_SERVER_ENTRYPOINT
. After these changes run the meteor profile
again.
The file literally just has import '..import/startup/client'
in it. Running now with some new lines in it as I think your right that should fix it. It just broke it because it was becoming import '..import/startup/client'console.log('new line')
It’s already got further than it did on previous attempts so that appears to have done the trick.
Thank you for the report. I’ll address this by adding a new line each time before if needed.
Another option could be running touch <entrypoint>
to prompt the bundler without modifying the file, not sure if it will work cross-OS, but I will try it. However, the bundler might not detect any change and still use the cache, which is why adding a new line with new content could be necessary.
I was very keen to try this as my build is crazy slow. Very interesting to see that it is sqlite query causing the majority of the issues rather than babel like most people. Is this likely because my queries are poorly optimised? That wouldn’t be surprising, this was the first project I built professionally and certainly would do lots of things differently database wise if I were to start over.
Top leaves:
| sqlite query…63,937 ms (1)
| Babel.compile…32,077 ms (979)
| files.readFile…3,880 ms (18927)
| jsAnalyze.parse…3,825 ms (5548)
| other reifyCompileWithCache…2,950 ms (4465)
| getPrelinkedFiles toStringWithSourceMap…2,225 ms (222)
| other ImportScanner#resolve…1,778 ms (21937)
| files.stat…1,750 ms (32410)
| files.writeFile…1,286 ms (4664)
===============================
Metrics - Cold start
- Meteor(resolveConstraints): 4998 ms
- Meteor(prepareProjectForBuild): 2096 ms
- Meteor(Build App): 127509 ms
- Meteor(Server startup): 2471 ms
- Total(Meteor): 137074 ms
===============================
Metrics - Cache start
- Meteor(resolveConstraints): 1171 ms
- Meteor(prepareProjectForBuild): 1808 ms
- Meteor(Build App): 32348 ms
- Meteor(Server startup): 1889 ms
- Total(Meteor): 37216 ms
===============================
Metrics - Rebuild client
- Meteor(resolveConstraints): 800 ms
- Meteor(prepareProjectForBuild): 749 ms
- Meteor(Build App): 34828 ms
- Meteor(Server startup): 1918 ms
- Meteor(prepareProjectForBuild #1): 43 ms
- Meteor(Rebuild App #1): 2061 ms
- Meteor(prepareProjectForBuild #2): 67 ms
- Meteor(Rebuild App #2): 1665 ms
- Total(Meteor): 42131 ms
===============================
Metrics - Rebuild server
- Meteor(resolveConstraints): 764 ms
- Meteor(prepareProjectForBuild): 794 ms
- Meteor(Build App): 36370 ms
- Meteor(Server startup): 1743 ms
- Meteor(prepareProjectForBuild #1): 45 ms
- Meteor(Rebuild App #1): 2254 ms
- Meteor(Server startup #1): 1590 ms
- Meteor(prepareProjectForBuild #2): 43 ms
- Meteor(Rebuild App #2): 2062 ms
- Meteor(Server startup #2): 1615 ms
- Total(Meteor): 47280 ms
What can one do on Meteor 2.16?
Thanks for the profile!
Meteor uses a SQLite database to track the remote catalog of Atmosphere packages for offline usage. After running a profile with the official release (not a Git checkout as I normally use to work on), I saw that SQLite queries take a huge amount of time. Apparently having your projects running from a Meteor Git checkout this SQLite database is not queried the same way as part of dev mode, and it could make you save even more, you can check out with meteor profile
if you try out the approach.
There’s clearly room for improvement for published releases on managing this local database, and your profile, along with others I’ve taken locally, shows that. We’ll work on this for the next 3.3 beta.
For now, everyone can test the SWC delivery in the first 3.3-beta.0.
Update: Check this profile comparing running from a published release (3.3-beta.0) vs a meteor git check out (release-3.3 branch) with the same changes.
Rebuilds are similar. Builds are slower in published releases due to some SQLite DB queries running distinctly. In Meteor checkout, only prepareProjectForBuild
is slower the first time; after that, performance improves. We should look into this.
The profile system seems to work instantly and without issues that’s a great addition!
/usr/local/bin/meteor npm run start-profile
> start-profile
> meteor profile --exclude-archs web.browser.legacy,web.cordova --settings settings-development.json
===============================
Profile script
===============================
- App path: /xxxxxxxxxxxx
- App port: 3000
- Logs file: /xxxxxxxxxxxx/logs/1745058188191-xxxxx-bundle.log
===============================
===============================
Full log details at /xxxxxxxxxx/logs/1745058188191-xxxxx-bundle.log
===============================
* Profiling "Cold start"...
* Profiling "Cache start"...
* Profiling "Rebuild client"...
* Profiling "Rebuild server"...
===============================
Npm packages
===============================
📦️ Dependencies
┌─────────┬─────────────────────────────────────────────┬────────────────────────────────┬─────────────────────────────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ (index) │ 0 │ 1 │ 2 │ 3 │
├─────────┼─────────────────────────────────────────────┼────────────────────────────────┼─────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 0 │ '@aws-sdk/client-s3@^3.363.0' │ '@aws-sdk/hash-node@^3.357.0' │ '@aws-sdk/protocol-http@^3.357.0' │ '@aws-sdk/s3-request-presigner@^3.363.0' │
│ 1 │ '@aws-sdk/signature-v4-crt@^3.425.0' │ '@aws-sdk/url-parser@^3.357.0' │ '@babel/runtime@^7.20.7' │ '@dnd-kit/core@^6.0.8' │
│ 2 │ '@dnd-kit/sortable@^7.0.2' │ '@editorjs/checklist@^1.6.0' │ '@editorjs/editorjs@^2.29.1' │ '@editorjs/header@^2.8.1' │
│ 3 │ '@editorjs/link@^2.6.2' │ '@editorjs/list@^1.9.0' │ '@editorjs/quote@^2.6.0' │ '@editorjs/raw@^2.5.0' │
│ 4 │ '@editorjs/simple-image@^1.6.0' │ '@faker-js/faker@^9.5.0' │ '@matterport/sdk@^1.4.24' │ '@print-one/moneybird-js@https://github.com/BLDBV/moneybird-js/releases/download/v1.9.4/moneybird-js.tar.gz' │
│ 5 │ '@types/geojson@^7946.0.12' │ '@types/leaflet@^1.9.3' │ '@types/mailparser@^3.4.5' │ '@types/meteor-mdg-validated-method@^1.2.10' │
│ 6 │ '@types/meteor-percolate-migrations@^1.0.0' │ 'adm-zip@^0.5.10' │ 'base64-stream@^1.0.0' │ 'bootstrap@^5.3.0' │
│ 7 │ 'bootstrap-icons@^1.10.5' │ 'date-fns@^3.0.0' │ 'date-fns-tz@^3.0.0' │ 'escape-string-regexp@^5.0.0' │
│ 8 │ 'express@^4.18.2' │ 'fabric@^5.3.0' │ 'fabricjs-react@^1.2.1' │ 'fast-xml-parser@^4.2.5' │
│ 9 │ 'frappe-gantt@^1.0.3' │ 'heic-convert@^2.1.0' │ 'http-proxy@^1.18.1' │ 'iconv-lite@^0.6.3' │
│ 10 │ 'image-thumbnail@^1.0.15' │ 'imap@^0.8.19' │ 'imapflow@^1.0.184' │ 'javascript-time-ago@^2.5.9' │
│ 11 │ 'json-rules-engine@^7.3.0' │ 'leaflet@^1.9.4' │ 'mailgun.js@^10.2.1' │ 'mailparser@^3.7.2' │
│ 12 │ 'meteor-node-stubs@^1.2.5' │ 'mime-types@^2.1.35' │ 'node-abort-controller@^3.1.1' │ 'node-imap@^0.9.6' │
│ 13 │ 'node-os-utils@^1.3.7' │ 'openweather-apis@^4.5.0' │ 'pdf-thumbnail@^0.0.1' │ 'pdfkit@^0.13.0' │
│ 14 │ 'pdfkit-table@^0.1.99' │ 'print-js@^1.6.0' │ 'prom-client@^15.0.0' │ 'pulltorefreshjs@^0.1.22' │
│ 15 │ 'qrcode@^1.5.3' │ 'react@^18.2.0' │ 'react-bootstrap@^2.7.4' │ 'react-calendar@^4.6.0' │
│ 16 │ 'react-dom@^18.2.0' │ 'react-draggable@^4.4.5' │ 'react-error-boundary@^4.0.13' │ 'react-helmet@^6.1.0' │
│ 17 │ 'react-hook-form@^7.45.4' │ 'react-leaflet@^4.2.1' │ 'react-pdf@^7.3.3' │ 'react-qr-scanner@^1.0.0-alpha.11' │
│ 18 │ 'react-router@^6.12.1' │ 'react-router-dom@^6.12.1' │ 'react-router-dom-last-location@^0.2.5' │ 'react-select@^5.8.0' │
│ 19 │ 'react-stars-screensaver@^1.1.0' │ 'react-xarrows@^2.0.2' │ 'react-zoom-pan-pinch@^3.3.0' │ 'really-relaxed-json@^0.3.2' │
│ 20 │ 'recharts@^2.15.0' │ 'showdown@^2.1.0' │ 'simpl-schema@^3.4.1' │ 'use-double-tap@^1.3.4' │
│ 21 │ 'use-long-press@^3.2.0' │ │ │ │
└─────────┴─────────────────────────────────────────────┴────────────────────────────────┴─────────────────────────────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
🛠️ DevDependencies
┌─────────┬──────────────────────────────────────────────────┬──────────────────────────────┬─────────────────────────────────────┬──────────────────────────────┐
│ (index) │ 0 │ 1 │ 2 │ 3 │
├─────────┼──────────────────────────────────────────────────┼──────────────────────────────┼─────────────────────────────────────┼──────────────────────────────┤
│ 0 │ '@babel/plugin-proposal-private-methods@^7.18.6' │ '@babel/preset-env@^7.22.9' │ '@quave/eslint-config-quave@^3.0.0' │ '@types/meteor@^2.9.4' │
│ 1 │ '@types/meteor-publish-composite@^0.0.39' │ '@types/mocha@^8.2.3' │ '@types/node@^18.13.0' │ '@types/react@^18.0.26' │
│ 2 │ '@types/react-dom@^18.0.10' │ '@types/react-helmet@^6.1.9' │ 'babel-loader@^8.3.0' │ 'cypress@^14.2.1' │
│ 3 │ 'eslint-plugin-react-hooks@^4.6.2' │ 'history@^5.3.0' │ 'mocha@^10.2.0' │ 'mongo-seeding@^3.7.2' │
│ 4 │ 'selenium-webdriver@^4.15.0' │ 'typescript@^4.9.4' │ 'webpack@^5.97.1' │ 'webpack-dev-server@^4.15.1' │
└─────────┴──────────────────────────────────────────────────┴──────────────────────────────┴─────────────────────────────────────┴──────────────────────────────┘
===============================
===============================
Meteor packages
===============================
☄️ Atmosphere
┌─────────┬────────────────────────────────────┬───────────────────────────────┬─────────────────────────────────┬────────────────────────────────────────┐
│ (index) │ 0 │ 1 │ 2 │ 3 │
├─────────┼────────────────────────────────────┼───────────────────────────────┼─────────────────────────────────┼────────────────────────────────────────┤
│ 0 │ 'accounts-base@3.1.0' │ 'accounts-password@3.1.0' │ 'alanning:roles@4.0.0' │ 'allow-deny@2.1.0' │
│ 1 │ 'autoupdate@2.0.0' │ 'babel-compiler@7.11.3' │ 'babel-runtime@1.5.2' │ 'base64@1.0.13' │
│ 2 │ 'binary-heap@1.0.12' │ 'boilerplate-generator@2.0.0' │ 'caching-compiler@2.0.1' │ 'callback-hook@1.6.0' │
│ 3 │ 'check@1.4.4' │ 'core-runtime@1.0.0' │ 'ddp@1.4.2' │ 'ddp-client@3.1.0' │
│ 4 │ 'ddp-common@1.4.4' │ 'ddp-rate-limiter@1.2.2' │ 'ddp-server@3.1.0' │ 'diff-sequence@1.1.3' │
│ 5 │ 'dynamic-import@0.7.4' │ 'ecmascript@0.16.10' │ 'ecmascript-runtime@0.8.3' │ 'ecmascript-runtime-client@0.12.3' │
│ 6 │ 'ecmascript-runtime-server@0.11.1' │ 'ejson@1.1.4' │ 'email@3.1.2' │ 'es5-shim@4.8.1' │
│ 7 │ 'facts-base@1.0.2' │ 'fetch@0.1.6' │ 'geojson-utils@1.0.12' │ 'hot-code-push@1.0.5' │
│ 8 │ 'hot-module-replacement@0.5.4' │ 'id-map@1.2.0' │ 'inter-process-messaging@0.1.2' │ 'launch-screen@2.0.1' │
│ 9 │ 'localstorage@1.2.1' │ 'logging@1.3.6' │ 'matb33:collection-hooks@2.0.0' │ 'mdg:validated-method@1.3.0' │
│ 10 │ 'meteor@2.1.0' │ 'meteor-base@1.5.2' │ 'minifier-css@2.0.1' │ 'minifier-js@3.0.1' │
│ 11 │ 'minimongo@2.0.2' │ 'mobile-experience@1.1.2' │ 'mobile-status-bar@1.1.1' │ 'modern-browsers@0.2.1' │
│ 12 │ 'modules@0.20.3' │ 'modules-runtime@0.13.2' │ 'modules-runtime-hot@0.14.3' │ 'mongo@2.1.1' │
│ 13 │ 'mongo-decimal@0.2.0' │ 'mongo-dev-server@1.1.1' │ 'mongo-id@1.0.9' │ 'montiapm:agent@3.0.0-beta.14' │
│ 14 │ 'montiapm:meteorx@2.3.1' │ 'npm-mongo@6.10.2' │ 'ordered-dict@1.2.0' │ 'percolate:migrations@2.0.0' │
│ 15 │ 'promise@1.0.0' │ 'random@1.2.2' │ 'rate-limit@1.1.2' │ 'react-fast-refresh@0.2.9' │
│ 16 │ 'react-meteor-data@3.0.3' │ 'reactive-var@1.0.13' │ 'reload@1.3.2' │ 'retry@1.1.1' │
│ 17 │ 'reywood:publish-composite@1.8.12' │ 'routepolicy@1.1.2' │ 'sha@1.0.10' │ 'shell-server@0.6.1' │
│ 18 │ 'socket-stream-client@0.6.0' │ 'standard-minifier-css@1.9.3' │ 'standard-minifier-js@3.0.0' │ 'static-html@1.4.0' │
│ 19 │ 'static-html-tools@1.0.0' │ 'tracker@1.3.4' │ 'typescript@5.6.3' │ 'underscore@1.6.4' │
│ 20 │ 'url@1.3.5' │ 'webapp@2.0.5' │ 'webapp-hashing@1.1.2' │ 'zodern:meteor-package-versions@0.2.2' │
│ 21 │ 'zodern:types@1.0.13' │ │ │ │
└─────────┴────────────────────────────────────┴───────────────────────────────┴─────────────────────────────────┴────────────────────────────────────────┘
===============================
===============================
Meteor version - METEOR@3.2
===============================
Meteor options - --exclude-archs web.browser.legacy,web.cordova --settings settings-development.json
===============================
===============================
Metrics - Cold start
===============================
- Meteor(resolveConstraints): 2401 ms
- Meteor(prepareProjectForBuild): 710 ms
- Meteor(Build App): 49411 ms
- Meteor(Server startup): 8189 ms
* Total(Meteor): 60711 ms
===============================
Metrics - Cache start
===============================
- Meteor(resolveConstraints): 600 ms
- Meteor(prepareProjectForBuild): 425 ms
- Meteor(Build App): 15837 ms
- Meteor(Server startup): 4681 ms
* Total(Meteor): 21543 ms
===============================
Metrics - Rebuild client
===============================
- Meteor(resolveConstraints): 506 ms
- Meteor(prepareProjectForBuild): 311 ms
- Meteor(Build App): 20044 ms
- Meteor(Server startup): 4640 ms
- Meteor(prepareProjectForBuild #1): 36 ms
- Meteor(Rebuild App #1): 4558 ms
- Meteor(prepareProjectForBuild #2): 29 ms
- Meteor(Rebuild App #2): 2590 ms
* Total(Meteor): 32714 ms
===============================
Metrics - Rebuild server
===============================
- Meteor(resolveConstraints): 560 ms
- Meteor(prepareProjectForBuild): 520 ms
- Meteor(Build App): 18587 ms
- Meteor(Server startup): 4943 ms
- Meteor(prepareProjectForBuild #1): 35 ms
- Meteor(Rebuild App #1): 4835 ms
- Meteor(Server startup #1): 5344 ms
- Meteor(prepareProjectForBuild #2): 31 ms
- Meteor(Rebuild App #2): 2796 ms
- Meteor(Server startup #2): 5066 ms
* Total(Meteor): 42717 ms
===============================
Full log details at /Users/xxxxxxxxx/logs/1745058188191-xxx-bundle.log
===============================
Process finished with exit code 0
This profile is ran locally on a recent MacBook Pro.
I think we use just default starting points:
"meteor": {
"mainModule": {
"client": "client/main.tsx",
"server": "server/main.ts"
},
"testModule": "tests/main.ts"
}
On ubuntu (also osX 15.4.1) I got this An error occurred when profiling
and in the last line of the logs it says.
.../node_modules/.cache/meteor/performance/scripts/monitor-bundler.sh: line 201: 71571 Killed METEOR_PROFILE="${METEOR_PROFILE:-1}}" METEOR_PACKAGE_DIRS="${METEOR_PACKAGE_DIRS}" ${meteorCmd} run ${meteorOptions}
Another issue is that the process says is got killed but in the console it keeps spinning
I think is timming out but I already added METEOR_IDLE_TIMEOUT=360 but still no luck.
I run profile on ubuntu without problems. What’s in line 201?
Mine is:
192 function waitMeteorApp() {
193 PROCESS_WAIT_TIMEOUT=3600000
194 processWaitTimeoutSecs=$((PROCESS_WAIT_TIMEOUT / 1000))
195 waitSecs=0
196 while ! isRunningUrl "http://localhost:${appPort}" && [[ "${waitSecs}" -lt "${processWaitTime>
197 sleep 1
198 waitSecs=$((waitSecs + 1))
199 done
200
201 echo ":: MeteorAppStarted"
202 }
Since it seems to finish the Cold and Cache phases and gets stuck on the rebuild client phase, the issue might be missing break lines at the end of your app’s entrypoint files.
Check your Meteor config in package.json
to see which files those are, and make sure they end with a break line. I haven’t fixed this yet. Hopefully, it’s just that, along with setting a higher timeout.
Adding an empty line didnt work, but creating the mock file on client did. Thanks. Here are the results.
metric | modernTranspiler | oldTranspiler | diff | diff % |
---|---|---|---|---|
Cold start | 36,674 | 62,855 | -26,181 | -41.7% |
Cache start | 20,873 | 24,619 | -3,746 | -15.2% |
Rebuild client | 26,413 | 29,562 | -3,149 | -10.7% |
Rebuild server | 30,825 | 34,667 | -3,842 | -11.1% |
Will it be possible to add the time to client refresh and to hmr? Probably not important if we are moving to vite.
Detailed logs
modernTranspiler: true
===============================
===============================
Meteor version - METEOR@3.3-beta.0
===============================
Meteor options - --settings=./.deploy/settings.dev.json
===============================
===============================
Metrics - Cold start
===============================
- Meteor(resolveConstraints): 2518 ms
- Meteor(prepareProjectForBuild): 515 ms
- Meteor(Build App): 31078 ms
- Meteor(Server startup): 2563 ms
* Total(Meteor): 36674 ms
===============================
Metrics - Cache start
===============================
- Meteor(resolveConstraints): 584 ms
- Meteor(prepareProjectForBuild): 449 ms
- Meteor(Build App): 17615 ms
- Meteor(Server startup): 2225 ms
* Total(Meteor): 20873 ms
===============================
Metrics - Rebuild client
===============================
- Meteor(resolveConstraints): 584 ms
- Meteor(prepareProjectForBuild): 442 ms
- Meteor(Build App): 17996 ms
- Meteor(Server startup): 2340 ms
- Meteor(prepareProjectForBuild #1): 42 ms
- Meteor(Rebuild App #1): 3016 ms
- Meteor(prepareProjectForBuild #2): 37 ms
- Meteor(Rebuild App #2): 1956 ms
* Total(Meteor): 26413 ms
===============================
Metrics - Rebuild server
===============================
- Meteor(resolveConstraints): 603 ms /
- Meteor(prepareProjectForBuild): 443 ms
- Meteor(Build App): 17969 ms
- Meteor(Server startup): 2228 ms
- Meteor(prepareProjectForBuild #1): 41 ms
- Meteor(Rebuild App #1): 2595 ms
- Meteor(Server startup #1): 2292 ms
- Meteor(prepareProjectForBuild #2): 33 ms
- Meteor(Rebuild App #2): 2354 ms
- Meteor(Server startup #2): 2267 ms
* Total(Meteor): 30825 ms
modernTranspiler: false
===============================
===============================
Meteor version - METEOR@3.3-beta.0
===============================
Meteor options - --settings=./.deploy/settings.dev.json
===============================
===============================
Metrics - Cold start
===============================
- Meteor(resolveConstraints): 2481 ms
- Meteor(prepareProjectForBuild): 504 ms
- Meteor(Build App): 57243 ms
- Meteor(Server startup): 2627 ms
* Total(Meteor): 62855 ms
===============================
Metrics - Cache start
===============================
- Meteor(resolveConstraints): 594 ms
- Meteor(prepareProjectForBuild): 457 ms
- Meteor(Build App): 21191 ms
- Meteor(Server startup): 2377 ms
* Total(Meteor): 24619 ms
===============================
Metrics - Rebuild client
===============================
- Meteor(resolveConstraints): 592 ms
- Meteor(prepareProjectForBuild): 451 ms
- Meteor(Build App): 20753 ms
- Meteor(Server startup): 2367 ms
- Meteor(prepareProjectForBuild #1): 40 ms
- Meteor(Rebuild App #1): 3170 ms
- Meteor(prepareProjectForBuild #2): 37 ms
- Meteor(Rebuild App #2): 2152 ms
* Total(Meteor): 29562 ms
===============================
Metrics - Rebuild server
===============================
- Meteor(resolveConstraints): 589 ms \
- Meteor(prepareProjectForBuild): 451 ms
- Meteor(Build App): 21301 ms
- Meteor(Server startup): 2336 ms
- Meteor(prepareProjectForBuild #1): 34 ms
- Meteor(Rebuild App #1): 2870 ms
- Meteor(Server startup #1): 2308 ms
- Meteor(prepareProjectForBuild #2): 32 ms
- Meteor(Rebuild App #2): 2437 ms
- Meteor(Server startup #2): 2309 ms
* Total(Meteor): 34667 ms
Ok so more info and more results.
When at home I use my desktop a ryzen 7 3800, 32gb ram and nvme ssd.
When on the go I use a macbook pro m4 with 48gb of shared memory.
I ran the profile in both machines with the same project and this are the results.
metric | ubuntu | osX | diff | diff % |
---|---|---|---|---|
Cold start | 36,674 | 18,385 | 18,289 | 99.5% |
Cache start | 20,873 | 10,412 | 10,461 | 100.5% |
Rebuild client | 26,413 | 11,380 | 15,033 | 132.1% |
Rebuild server | 30,825 | 13,949 | 16,876 | 121.0% |
I didnt expect the results will be so far appart between this 2 machines and os.
I will also add the comparison between old and modern transpiler on osX
metric | modern | old | diff | diff % |
---|---|---|---|---|
Cold start | 18,385 | 27,330.00 | -8,945 | -32.7% |
Cache start | 10,412 | 11,766.00 | -1,354 | -11.5% |
Rebuild client | 11,380 | 12,888.00 | -1,508 | -11.7% |
Rebuild server | 13,949 | 15,334.00 | -1,385 | -9.0% |
And here are the details
Old transpiler
Metrics - Cold start
- Meteor(resolveConstraints): 935 ms
- Meteor(prepareProjectForBuild): 242 ms
- Meteor(Build App): 24740 ms
- Meteor(Server startup): 1413 ms
- Total(Meteor): 27330 ms
===============================
Metrics - Cache start
===============================
- Meteor(resolveConstraints): 263 ms
- Meteor(prepareProjectForBuild): 216 ms
- Meteor(Build App): 10139 ms
- Meteor(Server startup): 1148 ms
- Total(Meteor): 11766 ms
===============================
Metrics - Rebuild client
===============================
- Meteor(resolveConstraints): 249 ms /
- Meteor(prepareProjectForBuild): 210 ms
- Meteor(Build App): 9544 ms
- Meteor(Server startup): 1064 ms
- Meteor(prepareProjectForBuild #1): 16 ms
- Meteor(Rebuild App #1): 1006 ms
- Meteor(prepareProjectForBuild #2): 16 ms
- Meteor(Rebuild App #2): 783 ms
- Total(Meteor): 12888 ms
===============================
Metrics - Rebuild server
===============================
- Meteor(resolveConstraints): 243 ms
- Meteor(prepareProjectForBuild): 211 ms
- Meteor(Build App): 9525 ms
- Meteor(Server startup): 1053 ms
- Meteor(prepareProjectForBuild #1): 16 ms
- Meteor(Rebuild App #1): 1227 ms
- Meteor(Server startup #1): 1027 ms
- Meteor(prepareProjectForBuild #2): 15 ms
- Meteor(Rebuild App #2): 1028 ms
- Meteor(Server startup #2): 989 ms
- Total(Meteor): 15334 ms
Modern transpiler
Metrics - Cold start
- Meteor(resolveConstraints): 943 ms
- Meteor(prepareProjectForBuild): 234 ms
- Meteor(Build App): 14841 ms
- Meteor(Server startup): 1444 ms
- Total(Meteor): 17462 ms
===============================
Metrics - Cache start
===============================
- Meteor(resolveConstraints): 267 ms
- Meteor(prepareProjectForBuild): 218 ms
- Meteor(Build App): 8911 ms
- Meteor(Server startup): 1095 ms
- Total(Meteor): 10491 ms
===============================
Metrics - Rebuild client
===============================
- Meteor(resolveConstraints): 257 ms
- Meteor(prepareProjectForBuild): 224 ms
- Meteor(Build App): 8376 ms
- Meteor(Server startup): 1055 ms
- Meteor(prepareProjectForBuild #1): 15 ms
- Meteor(Rebuild App #1): 860 ms
- Meteor(prepareProjectForBuild #2): 17 ms
- Meteor(Rebuild App #2): 708 ms
- Total(Meteor): 11512 ms -
===============================
Metrics - Rebuild server
===============================
- Meteor(resolveConstraints): 242 ms
- Meteor(prepareProjectForBuild): 212 ms
- Meteor(Build App): 8516 ms
- Meteor(Server startup): 1045 ms
- Meteor(prepareProjectForBuild #1): 17 ms
- Meteor(Rebuild App #1): 1057 ms
- Meteor(Server startup #1): 1029 ms
- Meteor(prepareProjectForBuild #2): 14 ms
- Meteor(Rebuild App #2): 971 ms
- Meteor(Server startup #2): 1020 ms
- Total(Meteor): 14123 ms
Will it be possible to add the time to client refresh and to hmr? Probably not important if we are moving to vite.
Yes, the time to refresh client and server is within the “Rebuild client” and “Rebuild server” phases. Specifically, the stages including #1 and #2, which correspond to the two file change that triggered rebuilds.
To clarify, I added new entries to the meteor profile
output: Total(Rebuild #1)
and Total(Rebuild #2)
. These sum up the prepareProjectForBuild
, Rebuild App
, and Server Startup
(only in server rebuild) stages for each run. This should give a clearer view of what’s relevant in that phase. To see the full rebuild metrics, use meteor reset
and run profiling again.
I enjoy seeing the profiles you share and the actual improvements in your projects. Meteor profiling has also been a quick way for each developer to check their own machines and, like you did, compare setups to see which one gives the best dev experience. Our time is valuable, and having a proper machine is a solid investment for daily work.
We’re planning a new set of changes that should lower those numbers even more.
To me, Meteor 3.3 is all about focusing on what Meteor really is, so we can support the bundler that builds our apps up to the point where we hit its limits.
Meteor 3.4 will push those numbers down further, as more of your app’s processes, like watching, transpiling, compiling, and minifying, will be delegated to a modern bundler. That lets Meteor concentrate on what matters: Atmosphere packages, the dev server, Mongo dev experience, and other specifics of the tool we love.
Ive seen the PR’s on github and it looks like it will get much better for speed in the next weeks.
Looking forward to test more of those improvements.
I’d love to test the refapp:meteor-typescript compiler too but it’s a bit complicated since, for unknown legacy reasons, a published compiler does NOT use dependencies from the meteor version you compile for but instead dependencies (e.g. BabelCompiler) that are published in the compiler package itself.
So to test, I would need to republish a new version of the compiler with meteor publish --release 3.3-beta0…
Will do that but not right now.
And I would love to understand why on earth isobuild published compilers don’t use dependencies from the meteor version it’s compiling for. I would guess this decision is lost in the annals of time…