Have you considered using dynamic imports? As for NPM we use the NPM service now for easy, but in past we’ve poorly used a “machine-user” as github calls them (a fake/blank user) and OAUTH tokens.
This is a lot of work for something meteor should just handle, and it does, its as you said meteor will pull from disk if it has, but I’ve tested on nvme drives and build times were still the same. The issue is CPU bound, which is thread bound. Webpack has some loader which allow for transpiling in threads, even the Jest testing framework will run in threads. Meteor has to come forward and make use of threading and hide the complexity.
I’m still using Meteor 1.6.0.1 still with Wekan, because trying to upgrade newer Meteor https://github.com/wekan/wekan/issues/1522 downgrades coffeescript always when building with meteor command. I did not yet find a way to force specific dependency version, so all this magic in reality distortion field makes me wish for something like Django’s “removing the magic” or Rust’s “language ergonomics”. I am still very grateful about all that Meteor has made easy when maintaining Wekan, and look forward to upgrading for all the new Meteor features. Only way that I can think of to currently speed up builds is using bare metal server that has powerful CPU.
Much of the overhead is in maintaining the in-memory cache. On every reload it looks at every single file to see if it has changed. The actual FS system calls themselves are quite fast, but there is still CPU overhead and memory allocation on the Node side (in many apps, 40% of build times are garbage collection).
Running strace on the Meteor build process is quite interesting. Here is an strace summary for a client-only rebuild in our application:
Note the massive number of FS system calls. The time spent in the kernel level system call is negligible (which is what strace reports), but the Node-side overhead is large. Looking at an actual CPU profile of rebuilds (using https://github.com/qualialabs/profile) confirms this suspicion.
Hi Benjamin,
The recent beta version 1.7.1-beta.21 is doing a pretty decent work !
Thanks.
I was quiet deseperate as my build time was getting worse and the application built on meteor 1.7.0.3.
More than 1 minute, each time I was editing a react file in the import forlder.
Meteor server + legacy build, running each time, and taking so long.
Seems that is fixed now, and I can’t thank you more !
Big up.
I’m working on large projects with Meteor and 1.7.0.3 we never have slow rebuild times, but then again we are very careful about how package.json looks so if you fill it with chromedriver or other stuff, even for “dev dependencies” be prepared to wait.
Even if you don’t have a lot of ram, meteor on a virtual machine with ubuntu+lubuntu will be faster and use less ram than native meteor on windows, at least with robust projects, so give it a try if you are on windows.
Even when using linux, my advice for developers/freelancers would be to just stay away from projects that use meteor. There should be a way to test/develop without compilation, recompiling while developing when you change a single byte on a single file that a modern browser like chrome can understand natively shouldn’t be a thing.
Even when using linux, my advice for developers/freelancers would be to just stay away from projects that use meteor. There should be a way to test/develop without compilation, recompiling while developing when you change a single byte on a single file that a modern browser like chrome can understand natively shouldn’t be a thing.
What do you recommend using, instead of Meteor? What web frameworks do not have compilation?
what vikr00001 said, I probably kept receiving bad set up projects. Getting extremely slow meteor projects to work on and not finding a solution for it was the main reason I eventually decided to fully stop developing for work. Since then I do it as a hobby sometimes and simply use native js ES5/6, one time I used webpack and babel
There was some version of Stylus dependency, that did build very slowly, because it had bug, where it did spend a lot of time in loop doing nothing important. That is why I converted my Stylus code to CSS:
Also, there has been fixes to Meteor to improve build time. When building with Meteor, it is possible to see Meteor profile, what time each dependency and step takes. Some dependency taking too much time can be a bug.