
Ask HN: Why is Atom a whopping 845 MB on my Mac? - PieUser
That is insane for a text editor. For comparison VS Code is only 192 MB on my Mac.
======
mailslot
There are many reasons. The elsephant in the room, being that it’s Javascript
and includes a full blown browser with a JS VM.

When I write a C or C++ app, if I use libcurl and a library I’m using does as
well, it links to the same shared libcurl library (mapped in RAM) as all other
running processes do as well. With NPM, you can’t share libraries across
process space and you’ll often even find the same packed being imported
multiple times within the same app. In JS, it’s like statically linking all of
your dependencies, but even less efficient. It can be argued that this is as
good as it is bad.

When you build a code ecosystem atop JS, the underlying inefficiencies
multiply as each layer is added. VS Code is more efficient, but even 192MB is
still pathetically bloated.

Expect Atom to eventually approach and surpass 1GB of RAM, not less... at
least in the short term.

~~~
narwally
Remember when we used to complain about Emacs being a memory hog for using
32MB?

~~~
jsrjenkins
I believe it was "Eight Megabytes And Constantly Swapping", or so the acronym
was jokingly in tbose days.

------
phendrenad2
At a high level, it's because Atom is buult from components, and each of those
components is made up of hundreds of components, and each of those is made
from hundreds of components, etc. Each component is general-purpose in some
way, and includes code that isn't used by Atom. To be slightly more specific,
when I pull apart components like this to figure out why they're so large
(like a 100MB XML-parsing library), the vast majority of the bulk is usually
huge tables of data, such as unicode mappings. Most likely, Atom contains
multiple components which contain the same data tables, but because of the
hierarchical nature of modern software development, no one can cut through the
layers and DRY up (denormalize?) that data.

~~~
insomniacity
Right, but isn't tree-shaking a thing now? Is it possible to do that with
Electron apps?

~~~
neilsimp1
I think developers probably tree-shake the HTML/CSS/JS that is running inside
of Electron, but tree-shaking all of Chromium can't be the easiest thing to
do. Not that I disagree with you, that should be a part of the Electron
publishing/packaging step.

------
rs23296008n1
Atom is ALSO a text editor. It's really a web browser in "to go" mode so it
brings all its dependencies and a whole lot more along with it. I'm sure there
are multiple copies of some components brought along for ride. I've seen this
with quite a few NPM based projects. eg three copies of the same module
because of dependencies in other modules.

Bloated for a text editor.

------
chuckkir
It's javascript. I think this article does a fine job explaining it:
[https://medium.com/s/silicon-satire/i-peeked-into-my-node-
mo...](https://medium.com/s/silicon-satire/i-peeked-into-my-node-modules-
directory-and-you-wont-believe-what-happened-next-b89f63d21558)

~~~
jamestimmins
"Imagine if the apple you were eating for breakfast had 291 ingredients, or if
the car you drove to work had 291 parts. You’d be worried, wouldn’t you?"

That's literally comparing...apples and cars. I would be _shocked_ if a car
only had 291 parts.

~~~
joshuata
Keep reading. The piece is satire.

------
Jyaif
I can't tell if it's 845 MB of RAM, or disk space. In any case, the answer is
that it costs less to create a bloated app.

------
mikestew
I'm not in front of a Mac right now, nor do I use Atom on said Mac, but you
can right-click on atom.app/Show Contents and get a directory layout of what's
in there. It won't break out the binary and statically compiled libraries, but
you can see if it's using large assets, or dragging along bunch of dynamic
libs.

------
miga
Ubuntu snap of Atom 206 is 178M squashfs, which uncompresses to 1.1GB. I
suppose that most of /Application/Atom is uncompressed data.

Snaps are similar to Mac packages, since they bundle most of the libraries
together with them.

------
choot
Just because something is named atom doesn't mean it's small.

It's a clever marketing.

Downvotes for pointing out the flaw in marketing vs reality.

------
db48x
Use objdump (or whatever the OSX equivalent is) and find out.

------
wilsonnb3
The real answer is because 845MB isn’t a lot of disk space or ram anymore.

~~~
watersb
I cannot tell if this is sarcasm.

FWIW, I am shopping for low-end laptops for kids in my extended family, and
Dad could use a new machine, but he wants Windows OS. These machines spec out
to 4GB RAM, 64 or 128GB eMMC or SSD.

Big apps are still a huge problems.

~~~
aidenn0
Is your dad going to be writing code on this low-end laptop?

~~~
narwally
I'd expect a modern laptop at any price point to be able to run a decent
development environment.

Edit: I made it all the way through a college CS program just fine using an
Acer Aspire one netbook with 4G of RAM.

~~~
aidenn0
That's a surprising expectation to an older developer coming from the days
when a home computer was less than a decent used car and a developer's
workstation was more than some new cars.

