Why is apm so ridiculously slow (for me)?


#1

apm is WAY too slow. Even the tiniest packages take forever.

Let’s use linter-js-yaml as a guinea pig.

$ time apm install linter-js-yaml
Installing linter-js-yaml to C:\Users\Owner\.atom\packages done

real    7m47.903s
user    0m0.045s
sys     0m0.197s

It’s like that with every single package. That’s absolutely ridiculous. Now, for comparison, under the same network load:

$ time git clone https://github.com/AtomLinter/linter-js-yaml.git
Cloning into 'linter-js-yaml'...
remote: Counting objects: 36, done.
remote: Total 36 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (36/36), done.
Checking connectivity... done.

real    0m1.477s
user    0m0.015s
sys     0m0.000s

$ time npm install
js-yaml@3.1.0 node_modules\js-yaml
├── esprima@1.0.4
└── argparse@0.1.15 (underscore@1.4.4, underscore.string@2.3.3)

real    0m21.489s
user    0m0.030s
sys     0m0.077s

Including .git and node_modules, that still only totals up to 9.42 MB. Yet Atom takes SEVEN minutes to install it. Why is this so incredibly slow?


#2

Inflammatory language! Get him, @leedohm! :hammer:

But seriously, if we take this point as a valid concern, and I do, let’s turn this thread productive:
Does anyone know what it is that apm does which could take that long? Clearly straight-forward installation isn’t all it does. Is there some cross-checking, test running or something going on?

I’m sure apm has a command line switch that gives us debug output of some kind?


#3

Nope.

  --compatible, -c  Only list packages/themes compatible with this Atom version
 [string]
  --help, -h        Print this usage message
  --silent, -s      Set the npm log level to silent
 [boolean]
  --quiet, -q       Set the npm log level to warn
 [boolean]
  --check           Check that native build tools are installed
 [boolean]
  --packages-file   A text file containing the packages to install
 [string]

I tried running with DEBUG=* NODE_DEBUG=* and got nothing.


#4

Yes, let’s use linter-js-yaml:

$ time apm install linter-js-yaml
Installing linter-js-yaml to /Volumes/Data/Users/Lee/.atom/packages ✓
apm install linter-js-yaml  1.50s user 0.45s system 28% cpu 6.764 total

1.5s doesn’t seem so very slow to me. A more accurate title for your post might be “Why is apm slow on my machine?”

One thing you can do to get at least a little more information is to run apm --version:

$ apm --version
apm  0.92.1
npm  1.4.4
node 0.10.26
python 2.7.5
git 2.0.3

Also, could you give the following information?

  • Which version of Atom are you using?
  • What OS and version are you running?

#5

Windows 7 x64, atom release v0.125, apm is from npm

$ apm --version --no-color
apm  0.92.1
npm  1.4.4
node 0.10.26
python 2.7.7
git 1.9.2.msysgit.0
visual studio 2013

#6

What kind of network connection are you using? Are you behind a proxy? Do you have the same experience when installing Node modules?


#7

DSL, peaks at 130 KB/s. Node modules (from npm) install fine and fairly quickly. No proxy.


#8

Is that a typo? That isn’t very much at all. 9MB at 130kb/s or less will definitely take a few minutes.


#9

This is a 6MB file. It shouldn’t take me 7 minutes to download less than twice that.

$ time curl http://nodejs.org/dist/v0.10.31/x64/node.exe -o temp.exe
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 6799k  100 6799k    0     0   109k      0  0:01:02  0:01:02 --:--:-- 95332

real    1m2.234s
user    0m0.015s
sys     0m0.000s

#10

You missed the magnitude. KB/s == kilobytes per second … Kb/s == kilobits per second. 9MB at 130 kilobytes per second is only about seventy seconds.


#11

9MB at 130 kilobytes per second is only about seventy seconds.

Which would be my internet speed, which is why I’m confused that apm takes forever.


#12

I suspect that there are some API calls in between that are taking up the other time.

You should probably file a bug on the apm package and see if the developers have any suggestions. When I get home from some errands later, I’ll probably file a bug for better profiling options.


#13

I didn’t miss it. He said that 130kb/s is where his connection peaks. That makes me think that the average is probably quite a bit slower.

Of course I can’t be sure what that average is and since similar installations via npm are faster (from what I understood), there’s probably something else to look at.
But either way, 130kb/s is already very slow for today’s standards and who knows what else interferes with the connection.


#14

Average speed is around 100 KB/s. I am speaking in kiloBYTES per second, not kiloBITS. Notice that both the K and B are capital.


#15

Yes I do understand the difference between KB and Kb.

All I’m saying is that100KB/s x 60sec = 6 MB/min, so you’re going to take a good 1 1/2 to 2 minutes for your 9.4MB download alone. Like I said, there will be other issues involved and who knows what else happens during an apm install, or whether your network has other deficiencies (say, proxy or firewall shenanigans, what have you), but you’re certainly not going to get the 1.5 seconds @leedohm is getting.
All I’m saying.

Let’s move on and see what else could hamper your apm installation.


#16

So on my Windows machine (Win8, with a fairly ok 6Mb/s line) I did the same package (apm install linter-js-yaml) and I’m getting roughly 30 seconds (I don’t know if Windows has a convenient timer like you Mac guys seem to enjoy).


#17

Unfortunately apm is also very slow for me, I’m on Windows 8.1 (64 bit). So far I haven’t been able to figure out why it is so slow. I do have a slow connection (~350-400 KB/s), but this should not be the bottle neck for such a small package, for completeness:

$ time git clone https://github.com/AtomLinter/linter-js-yaml.git
Cloning into 'linter-js-yaml'...
remote: Counting objects: 36, done.
remote: Total 36 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (36/36), done.
Checking connectivity... done.

real    0m1.737s
user    0m0.000s
sys     0m0.015s

Installing the linter-js-yaml package using apm install:

$ time apm install linter-js-yaml
Installing linter-js-yaml to C:\Users\Philippe\.atom\packages done

real    1m56.588s
user    0m0.000s
sys     0m0.015s

I know that a few months ago I ran into a node error that looked like this when installing certain packages. apm would run for ages (30+ minutes) before returning an error. After adding the suggested directories to the path that problem disappeared and apm was able to install all packages, but still runs fairly slow.

I’d be happy to provide more information if anyone has any ideas on how to start investigating the problem.

$ apm --version
apm  0.92.0
npm  1.4.4
node 0.10.26
python 2.7.8
git 1.9.4.msysgit.0
visual studio

@batjko : If you can use Git Bash you have access to the most basic Linux goodies. :slight_smile:


#18

I had this problem when I started with Atom a few months ago but recently it seems better. I just assumed the Atom.io server was slow.

I’m on windows 8.0 with Atom 125.


#19

I just noticed this seems to be on Windows.


#20

Anecdotally I’ve noticed apm taking much longer than would be expected of files the size it downloads. The problem may have been especially exaggerated on Windows, though I haven’t used windows in a while now. I haven’t really looked into it extensively.