News for hackers. Stuff that matters.
Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by mailslot on Wednesday November 21, 2018 @12:35PM (#18504393)
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.

Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by narwally on Wednesday November 21, 2018 @05:46PM (#18506705)
Remember when we used to complain about Emacs being a memory hog for using 32MB?
Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by jsrjenkins on Wednesday November 21, 2018 @07:30PM (#18507144)
I believe it was "Eight Megabytes And Constantly Swapping", or so the acronym was jokingly in tbose days.
Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by tuananh on Wednesday November 21, 2018 @09:18PM (#18507501)
but this doesn't explain why VSCode is still small (<200MB)
Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by phendrenad2 on Wednesday November 21, 2018 @11:52AM (#18503997)
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.
Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by insomniacity on Wednesday November 21, 2018 @03:39PM (#18505874)
Right, but isn't tree-shaking a thing now? Is it possible to do that with Electron apps?
Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by neilsimp1 on Wednesday November 21, 2018 @03:51PM (#18505974)
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.
Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by rs23296008n1 on Wednesday November 21, 2018 @03:32PM (#18505812)
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.

Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by chuckkir on Wednesday November 21, 2018 @03:54PM (#18506006)
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...
Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by jamestimmins on Wednesday November 21, 2018 @04:35PM (#18506293)
"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.

Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by joshuata on Wednesday November 21, 2018 @05:05PM (#18506484)
Keep reading. The piece is satire.
Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by Jyaif on Wednesday November 21, 2018 @02:43PM (#18505406)
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.
Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by mikestew on Wednesday November 21, 2018 @03:26PM (#18505768)
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.
Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by miga on Wednesday November 21, 2018 @03:49PM (#18505961)
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.

Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by choot on Thursday November 22, 2018 @02:32PM (#18512002)
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.

Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by db48x on Wednesday November 21, 2018 @02:18PM (#18505218)
Use objdump (or whatever the OSX equivalent is) and find out.
Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by wilsonnb3 on Wednesday November 21, 2018 @03:24PM (#18505754)
The real answer is because 845MB isn’t a lot of disk space or ram anymore.
Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by watersb on Wednesday November 21, 2018 @04:06PM (#18506101)
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.

Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by aidenn0 on Wednesday November 21, 2018 @05:39PM (#18506677)
Is your dad going to be writing code on this low-end laptop?
Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by narwally on Wednesday November 21, 2018 @05:50PM (#18506725)
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.

Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by aidenn0 on Wednesday November 21, 2018 @06:30PM (#18506895)
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.
Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by leetcrew on Wednesday November 21, 2018 @07:59PM (#18507266)
it's not sarcasm. 4GB is a pathetic amount of ram for a new computer in 2018. the last computer I had with 4GB of ram was a laptop I bought in the late '00s. a 2x4GB kit of DDR4 for a laptop costs about $50 on newegg right now.

the kids should be glad to have any computer a relative will buy for them, but it's probably wasteful to purchase such an underprovisioned machine for an adult who will actually take care of it.

Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by beatgammit on Thursday November 22, 2018 @10:12AM (#18510401)
Looking at laptops with my dad (he's buying for himself as a retired person), the laptops he liked were either $500-600 with decent specs (i3 with hyperthteading) except low RAM or overkill (i7) for $800+.

I found it difficult to justify the more beefy machine aside from RAM, and paying $200+ for 4gb more RAM is silly, so he'll probably get the cheaper option and upgrade RAM if it becomes a problem.

The sad part is that Windows takes nearly half of that, by he said he only needs word processing, viewing pictures of grandkids, and some light browsing. That same thing was quite reasonable a few years ago on 2gb, but now everything is bloated to the point where 4gb is feeling tight...

As a developer, I consider 16gb to be a minimum for my dev machine, but why do basic computers need 8gb these days? Tablets do about the same workload, but only need 3-4gb max...

Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by leetcrew on Friday November 23, 2018 @12:02PM (#18517574)
first of all, you are definitely right that it is silly to pay $200 more when all you care about is the extra 4GB ram. if i were in that position, i would buy the 4GB laptop and immediately upgrade the ram. the problem is that not everyone is comfortable upgrading ram themselves, and many modern ultraportables have the ram soldered in anyway. 4GB is honestly okay as a bare minimum for 2018, but it will rapidly become the system bottleneck in the coming years.

> why do basic computers need 8gb these days? Tablets do about the same workload, but only need 3-4gb max...

mobile software is still designed pretty differently than its desktop/laptop counterparts. take the browser for instance, probably the most widely used software by light users. while i type this post, firefox is taking up over 1GB just to have five tabs open, and it seems to use 100-200 MB more for each additional tab. that's a lot of memory, but the upside is that each tab is fully loaded in memory and can be switched to in an instant. on my phone, firefox uses way less memory, but only the current tab (or maybe a couple recently viewed ones) is actually loaded in memory. switching tabs on mobile triggers a page reload from disk or over the network, orders of magnitude slower than the desktop experience. certainly there are some lazy devs out there that waste our memory, but at the core there is a intrinsic tradeoff between memory usage and performace. it's always faster to load from memory than to read from storage. i doubt you would want to trade desktop/laptop class performance for mobile class memory footprint on your main device.

Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by tuananh on Friday November 23, 2018 @03:52AM (#18515241)
iPad is perfect for those use cases. it's fast, lightweight and the battery is much better than those laptops.
Re:Ask HN: Why is Atom a whopping 845 MB on my Mac? by nitwit005 on Wednesday November 21, 2018 @03:48PM (#18505946)
Sort of. I'm sure they've had people with slow connections give up on downloading the thing.