Join the Effort to Speed Up Meteor bundler

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
3 Likes

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
1 Like

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. :star_struck: 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. :crossed_fingers:

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.

6 Likes

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.

4 Likes

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…