Faster Meteor Reloads


#1

Compiling with meteor when developing can be sooooo slow. I know this is a known issue. Is this something the meteor team is looking to rectify? Any insight would be appreciated.


#2

What OS are you using?


#3

I’ve got a macbook pro. 8GB ram 2.7 GHz i5

OS - macOS Sierra


#4

Other than making sure you are using the latest version of meteor, and disabling any anti-virus/anti-malware scanning, you might try suggestions from the following:


#5

None of this seems to be making a difference. If I run METEOR_PROFILE=1 meteor the majority of the build time appears to be coming from

(#1) Profiling: Server startup
(#1) Total: 9,090 ms (Server startup)

This seems to be related to all the packages. Does this need to update everytime I alter front end code?


#6

It shouldn’t need to unless you have code being updated that both the client and server depend on.


#7

Please try https://github.com/qualialabs/profile and post your CPU profiles


#8

Ooo - I like that! :slight_smile:

Now, if we only had a tool to analyse the output of the meteor process when using the various debugging environment variables…


#9

What do you mean? This package allows you to take profiles of both the meteor build and server process at any time


#10

My point was more about how to digest the information provided by something like

METEOR_DEBUG_BUILD=1 METEOR_PROFILE=10 meteor run

and to some extent

meteor list --tree --weak

as another aid to problem solving.


#11

I’m going to do a blog post on performance analysis of CPU profiles soon; has vastly more info than the debug output


#12

Ok, I’ve done my best here. I haven’t been able to get it to produce client-rebuild.cpuprofile.

full-rebuild.cpuprofile

initial-build.cpuprofile

startup.cpuprofile


#13

I’m wondering if this is related to my folder structure. ui and pages folders are located in the imports folder. Should it be:

imports
  client
    ui
     pages

#14

The latter two links aren’t working for me; I suspect that the startup.cpuprofile will be the most relevant one. Happy to take a look once you’ve re-uploaded it


#15

When you save changes to code, what does the terminal say?
Client modified -- refreshing or Meteor server restarted?
If you’re only modifying client code it sd say the former.
Client modifications take way less time than server restarts.


#16

Sorry about that. Not sure why they didn’t work. Links have now been fixed.


#17

Yeah it’s meteor server restarted. I don’t understand why the imports folder would cause a full server restart.


#18
  • Create client folder inside of imports folder
  • Put everything client related (ui, startup, etc) there. Then it will only refresh the browser, not the whole server process.
  • Bang! PROFIT

Everything that’s not inside client or server folders is loaded both on client and server. And changes to server code require restarts.


#19

Thanks for that. Driving me crazy.


#20

I think there’s something wrong with your dev DB (or your connection to the dev DB). In the server startup profile, it spends 1.5 seconds actually starting up and then around 9 seconds very occasionally making DB related calls and waiting a long time.