Extreme build time on fresh meteor run

Hey guys,

I’m a bit in trouble right now. Updated to 2.5.6 on my M1 MBA. Besides, changed some cordova plug ins. Build times were quite slow before but now I’d consider them extreme (cf. gist below with almost half an hour build time).

I tried some usual suspects (like meteor reset, complete reinstall of meteor, remove node_modules, removed some no longer needed modules, complete fresh clone of my private repo etc, and playing around with node garbage collection and memory allocation)

Here’s my gist of meteor run with some tweaks and METEOR_PROFILE=100 applied

Here’s my package.json

my meteor packages

aaaand my cordova plugins (if this applies to meteor run at all)

I also have some optional files in “cordova-plugin-override” and already tried building without them.

Any hints greatly appreciated. And no, I can’t add any more RAM to my 8GB machine :wink:

You might want to open an issue for Meteor. Some parts of the build process I haven’t really seen used are being run a very large number of times for your app, and there might be some simple optimizations we can make.

To clarify, after the app finished building, if you stop meteor then run it again is it still 30 minutes, or is it less than 5?

I reran with ~30 min, then 5:35 min, then 11:56 min. I also observed that after the last call of meteor run, a minor change in a client-side source file led to a ~30 sec rebuild but left the server unresponsive (no response on localhost:3000).

Is it ok to refer to this forum entry in an issue?

I think I could make some improvements in my building process. I try to document my steps here, maybe it’s helpful for someone.

First the result: build time after meteor reset is now at about 3:30 min, rerunning meteor run took 42 secs, so way faster than before. Here’s from the profiling of the first run:

The large number of InputScanner calls led me to this issue https://github.com/meteor/meteor/issues/11088 and this one https://github.com/meteor/meteor/issues/10712. Then I followed option 2 for babel-plugin-transform-imports from this guide since I extensively use v4 material-ui in my project and imports were not fine.

@zodern I’m really a novice to meteor building process tweaks, does this sound like a reasonable solution to you?