Globally install apm for faster more consistent start up time?


#1

It Started With a Tweet

I was browsing Twitter & someone mentioned a possible way of speeding Atom’s start up time. I was curious so I tried it out & it see it seemed to worked for me, but I’m curious about it working on other systems. Tweet thread here: https://twitter.com/nickytonline/status/715008963591405569

Before globally installing atom-package-manager on system, my Atom window load time was hitting 1620ms, 2612ms, sometimes it would be < 1200ms but on average more than 1300ms. Occasionally I would load under 1300ms. After a modification my Atom now consistently loads at round 1200ms. Your load time will vary due to your computer’s hardware specs. Also some of my packages, have been loading quicker, according to the timecop package.

Results Before



Results After



Testing Atom Load Times

To find out how long it takes Atom to load:

- quit atom completely.
- next, open atom 
- After Atom has loaded, call the  **timecop** package via the command palette (command + shift + p -> type 'time cop' -> hit enter or select it)

After that you should see something like this:

Repeat the steps above a few times ~5 & keep note of the ​Window load time​.
After, check if you have atom-package-manager installed globally with npm, which it shouldn’t be unless you did this already:

npm list -g --depth=0

Next, install ​atom-package-manager​ globally:

npm install -g atom-package-manager

After that quit atom & try timecop a few times to see for any changes.

In Summary

Before this modification, my atom load times were inconsistent. After this, my Atom load times decreased on average & became more consistent.

Currently on Atom version 1.6.1


#2

Have you tried running apm after doing this? It fails to work at all for me after installing globally.

apm installed through npm i -g is at version 1.9.2 but apm bundled with the stable release of Atom is 1.6.0, so maybe tread carefully here.

Are you sure the speed boost is caused by global installing instead of the difference between versions of apm? Installing apm globally means updating it separately from Atom, which might be less stable unless you are looking at change logs of both Atom and apm every once in a while and then specifying versions (which sounds like a lot of work for faster load times). Or am I missing something here?

After trying that I am going to have to leave it alone, I think. I’m getting ~900-1000ms load times in Atom, currently.


#3

@opattison If you’re referring to using apm from the command line(CLI); I really don’t use it from the CLI. If you’re referring to the package manager inside the editor for downloading themes & packages, I also haven’t had any issues yet.

Thanks you for your detailed responses; I learned a few things about apm from you =).

Curious, are you running 1.6 or the beta 1.7?


#4

I use apm all the time to try packages (and occasionally to publish themes), so it’s essential that it runs predictably.

I am running Atom 1.6.1 (main release) right now.


#5

apm isn’t used during startup to my knowledge. So any startup gains after changing where or how apm is installed are most likely unrelated. Additionally, anything in Atom that does use apm will most likely use atom.packages.getApmPath() in order to find it. And that function only returns the path to the version installed with Atom, not any globally-located copy of apm.


#6

You have 3 less files compiled on your first run “before”, 19 babel files on the second run, and 12 less files on the third run, so that skews your test quite a lot.

Why this happens, I couldn’t tell. But probably something to do with compilation cache invalidation, or you installing new packages. You might try wiping ~/.atom/compile-cache and restarting Atom a few times to make sure everything is compiled, and then testing if installing apm globally changes anything.