Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

atom as an editor is too big #9755

Closed
crquan opened this issue Nov 23, 2015 · 20 comments
Closed

atom as an editor is too big #9755

crquan opened this issue Nov 23, 2015 · 20 comments
Labels

Comments

@crquan
Copy link

crquan commented Nov 23, 2015

compare to sublime 3 is 7.2MB

mint@gnome3-on-mac:~$ (cd Downloads/; ls -lh atom* sublime* )
-rw-r--r-- 1 mint users  68M Nov 19 13:45 atom-amd64.deb
-rw-r--r-- 1 mint users 7.2M Mar 26  2015 sublime_text_3_build_3083_x64.tar.bz2

install size: atom is 208M vs. sublime3 is 17M

$ (cd Downloads/; dpkg-deb --fsys-tarfile atom-amd64.deb ) |tar -xvv ./usr/share/atom/
drwxr-xr-x root/root         0 2015-11-19 13:44 ./usr/share/atom/
-rw-r--r-- root/root    410849 2015-11-19 13:44 ./usr/share/atom/natives_blob.bin
-rw-r--r-- root/root    587068 2015-11-19 13:44 ./usr/share/atom/snapshot_blob.bin
-rw-r--r-- root/root  10206624 2015-11-19 13:44 ./usr/share/atom/icudtl.dat
-rw-r--r-- root/root      1055 2015-11-19 13:44 ./usr/share/atom/LICENSE
-rw-r--r-- root/root    520152 2015-11-19 13:44 ./usr/share/atom/libgcrypt.so.11
-rwxr-xr-x root/root  59086736 2015-11-19 13:44 ./usr/share/atom/atom
-rw-r--r-- root/root         7 2015-11-19 13:44 ./usr/share/atom/version
[...]
mint@gnome3-on-mac:~$ \du -xsh ./usr/share/atom/
208M    ./usr/share/atom/
mint@gnome3-on-mac:~$ \du -xsh ./opt/sublime_text_3/
17M ./opt/sublime_text_3/

run like:

mint@gnome3-on-mac:~$ ./usr/share/atom/atom
App load time: 299ms

I'm trying to understand why it's so large: it seems a nodejs project / embedding a nodejs v0.10.40 binaries, and suffering the same nodejs project's recursive node_modules problem,

mint@gnome3-on-mac:~$ \du -xa ./usr/share/atom |sort -n
[...]
3748    ./usr/share/atom/resources/app/apm/node_modules/npm/node_modules/request
4244    ./usr/share/atom/resources/app.asar.unpacked/node_modules
4284    ./usr/share/atom/resources/app/apm/node_modules/first-mate
4884    ./usr/share/atom/resources/app.asar.unpacked
5864    ./usr/share/atom/chromedriver/chromedriver
5872    ./usr/share/atom/chromedriver
8540    ./usr/share/atom/content_shell.pak
9968    ./usr/share/atom/icudtl.dat
10784   ./usr/share/atom/resources/app/apm/node_modules/npm/node_modules
11184   ./usr/share/atom/resources/app/apm/bin/node
11196   ./usr/share/atom/resources/app/apm/bin
11796   ./usr/share/atom/resources/app/apm/node_modules/npm
16384   ./usr/share/atom/libnode.so
21744   ./usr/share/atom/resources/app/apm/node_modules
33516   ./usr/share/atom/resources/app/apm
33524   ./usr/share/atom/resources/app
57704   ./usr/share/atom/atom
73464   ./usr/share/atom/resources/app.asar
112480  ./usr/share/atom/resources
212484  ./usr/share/atom
mint@gnome3-on-mac:~$ ls -lh ./usr/share/atom/resources/app.asar
-rw-r--r-- 1 mint users 72M Nov 19 13:44 ./usr/share/atom/resources/app.asar
mint@gnome3-on-mac:~$ \du -xsh ./usr/share/atom/resources/app.asar [...]
72M ./usr/share/atom/resources/app.asar
33M ./usr/share/atom/resources/app/apm
22M ./usr/share/atom/resources/app/apm/node_modules
16M ./usr/share/atom/libnode.so
12M ./usr/share/atom/resources/app/apm/node_modules/npm
11M ./usr/share/atom/resources/app/apm/bin/node
11M ./usr/share/atom/resources/app/apm/node_modules/npm/node_modules
mint@gnome3-on-mac:~$ ./usr/share/atom/resources/app/apm/bin/node -v
v0.10.40
mint@gnome3-on-mac:~$ find ./usr/share/atom -name node_modules |wc -l
90
mint@gnome3-on-mac:~$ find ./usr/share/atom -name node_modules -exec ls -1 {} \; |wc -l
277
mint@gnome3-on-mac:~$ find ./usr/share/atom -name node_modules -exec ls -1 {} \; |sort -u |wc -l
223

The largest ones are app.asar (72M), apm (33M), and node binaries (16M+11M), and there are 90 node_modules directories totally, from 277 to unique 223 package names means a lot of potential duplicate code,

The app.asar (72M) resource file seems to be a large plain text file with 16 bytes binary header, is that a webpack or something I don't understand, look like a plain text javascript file, why it needs to be 72MB large? why not try some xz or gzip compressed resource?

mint@gnome3-on-mac:~$ file ./usr/share/atom/resources/app.asar
./usr/share/atom/resources/app.asar: data
mint@gnome3-on-mac:~$ hexdump -C ./usr/share/atom/resources/app.asar |& head -n40
00000000  04 00 00 00 b0 08 0b 00  ac 08 0b 00 a5 08 0b 00  |................|
00000010  7b 22 66 69 6c 65 73 22  3a 7b 22 64 6f 74 2d 61  |{"files":{"dot-a|
00000020  74 6f 6d 22 3a 7b 22 66  69 6c 65 73 22 3a 7b 22  |tom":{"files":{"|
00000030  2e 67 69 74 69 67 6e 6f  72 65 22 3a 7b 22 73 69  |.gitignore":{"si|
00000040  7a 65 22 3a 34 31 2c 22  6f 66 66 73 65 74 22 3a  |ze":41,"offset":|
00000050  22 30 22 7d 2c 22 69 6e  69 74 2e 63 6f 66 66 65  |"0"},"init.coffe|
00000060  65 22 3a 7b 22 73 69 7a  65 22 3a 33 38 36 2c 22  |e":{"size":386,"|
00000070  6f 66 66 73 65 74 22 3a  22 34 31 22 7d 2c 22 6b  |offset":"41"},"k|
00000080  65 79 6d 61 70 2e 63 73  6f 6e 22 3a 7b 22 73 69  |eymap.cson":{"si|
00000090  7a 65 22 3a 31 30 30 34  2c 22 6f 66 66 73 65 74  |ze":1004,"offset|
000000a0  22 3a 22 34 32 37 22 7d  2c 22 70 61 63 6b 61 67  |":"427"},"packag|
000000b0  65 73 22 3a 7b 22 66 69  6c 65 73 22 3a 7b 22 52  |es":{"files":{"R|
000000c0  45 41 44 4d 45 2e 6d 64  22 3a 7b 22 73 69 7a 65  |EADME.md":{"size|
[...]
mint@gnome3-on-mac:~$ tail -c +17 ./usr/share/atom/resources/app.asar | less
{"files":{"dot-atom":{"files":{".gitignore":{"size":41,"offset":"0"},"init.coffee":{"size":386,"offset":"41"},"keymap.cson":{"size":1004,"offset":"427"},"packages":{"files":{"README.md":{"size":60,"offset":"1431"}}},"snippets.cson":{"size":698,"offset":"1491"},"styles.less":{"size":762,"offset":"2189"}}},"exports":{"files":{"atom.js":{"size":1642,"offset":"2951"}}},"less-compile-cache":{"files":{"008ee39f25f61883969b7638fa1eee8c89057781":{"files":{"content":{"files":{"03fe3eda02e330109d9471f0f9bb8033fc5284ea":{"files":{"package-card.json":{"size":7316,"offset":"4593"},"package-readme.json":{"size":2464,"offset":"11909"},"settings-view.json":{"size":17570,"offset":"14373"},"variables.json":{"size":286,"offset":"31943"}}},"0ca72fa78b0f02602636d1eea2ee52e59c89b9ba":{"files":{"find-and-replace.json":{"size":7516,"offset":"32229"}}},"10da4fc591498d7e0cc359330a4c634853928cc9":{"files":{"incompatible-packages.json":{"size":1442,"offset":"39745"}}},"235ea17d31c14d2abdb70d798d0a0a2c444344c9":{"files":{"encoding-selector.json":{"size":725,"offset":"41187"}}},"38c4d79a3870966993e7817b7331827c4ff9d8f7":{"files":{"index.json":{"size":5280,"offset":"41912"}}},"3cf8cf26996687e169a7146b88246c1b913a6656":{"files":{"tree-view.json":{"size":1951,"offset":"47192"}}},
[...]

Could you atom developers try to reduce the size ? is there any one making effort on any node dedupe solution? if can't compare with sublime, anyway keep install size below 100M or even smaller would be much appreciated; thanks

@lee-dohm
Copy link
Contributor

Atom has been reduced in size significantly in the past (#6313, #6407, #6395, #6447, atom/notifications#54, among others). As a matter of fact, the app.asar that you mention compressing is a compressed file. (See the atom/asar repository for more information on the file format.)

If you have examples of duplicate code or specific suggestions of methods for shrinking the size of Atom, please open Issues or Pull Requests with that information. Unfortunately, I fear that simply "make it smaller" is not specific enough to be actionable.

@crquan
Copy link
Author

crquan commented Nov 24, 2015

I'm not a node developer don't even know how to hack this project.
Only providing my general feedback here, 208MB is beyond the size of an editor should be,

the app.asar is not compressed anyway, if you open it with a hex editor, you will see 90%+ of this 72MB file is plain text, which means further compressable, here I apply a simple xz compress get a 13MB file, but I don't know how to change the main binary to load resource from the compressed file

-rw-r--r-- 1 mint users  72M Nov 19 13:44 app.asar
-rw-r--r-- 1 mint users  13M Nov 19 13:44 app.asar.xz

@anaisbetts
Copy link
Contributor

There are a number of things that Atom could do to reduce install size, but tbh, does it really matter? Engineering work costs time, and optimizing disk space isn't really worth that time given that you can buy a 16GB USB Thumb drive on Amazon for less than a cup of coffee (in San Francisco :P). That's 78 copies of Atom, for $5.

@Zireael07
Copy link

I think the original user's concern is not about disk space but download bandwidth. Disk space is indeed cheap. Bandwidth isn't so, especially if you live somewhere where you can't switch ISPs.

@crquan crquan changed the title atom as an editor is too big ? heavy ? large (fat) ?: the latest atom-amd64.deb package is 68MB, install size 208M atom as an editor is too big Nov 29, 2015
@crquan
Copy link
Author

crquan commented Nov 29, 2015

can buy a 16GB USB Thumb drive

that's not a good excuse for doing nothing, not everybody like you github employees (I heard most atom developers are ?) has a macbook for each, and there are many ones still using old computers, ...

@lee-dohm
Copy link
Contributor

you github employees

This is challenging the person, not the idea, and is generally considered poor form in online discussions.

You still haven't addressed my concern with this Issue, @crquan, namely that there isn't a method of determining if Atom is "beyond the size of an editor should be". You only state that 208MB is too much. A bug is nearly worthless if it cannot ever be fixed. And without a clearly defined goal, this bug cannot be fixed.

Is 207MB too big? Is 200MB? Is 10MB? Please give an example of what size is "small enough" and what size "too big" and, most importantly, why.

@thedaniel
Copy link
Contributor

In any case, as long as Atom uses electron, it's going to be an order of magnitude larger on disk than the example you provided (sublime 3 at 7 megs) because of libchromiumcontent, etc. We're generally working on reducing the file size of the editor where we can, but I am going to close this issue in favor of more specific issues - you could, for example, have a conversation about the pros and cons of asar actually doing compression rather than concatenation on the electron repository, or file an issue about problems with dependency deduping in atom.

Still, Atom is likely going to be in the 100 meg order of magnitude, not 10 , for the forseeable future.

@qcq
Copy link

qcq commented Jan 24, 2016

I really agree with @crquan , The package is too big, However the Atom is open source, May be This is a only advantage vs sublime, If so, How can atom accepted by common people. We all know sublime can use free for a long time which you can think. @lee-dohm as a common user, We already find the "bug" lies, not us to fix it. Not all common people go through all the code which Atom has. This is just suggestion or mind which everyone can see it.

@texelate
Copy link

I'll add my comment, albeit late. I am using Atom on Xubuntu running alongside Chrome OS. I only have a 16 GB SSD to play with and once you factor in the Chrome OS, Xubuntu and the necessary software that comes with them, there isn't much room left. I currently only have 2.5 GB left so Atom is taking up 10% of that.

@qcq
Copy link

qcq commented Sep 1, 2016

@thedaniel, I do not think it is a good idea to close this, even have a plan to reduce the size of atom, why not keep this open as a place where can remind us we have a really important thing to do. not just a idea.
@paulcbetts, I want to speak directly, the words "very cheap to buy a USB" seems really ridiculous. if that is right, why not make atom more bigger, to 2G. or what else...... what is the meaning of one software which exist? especially loved by people. that is ..... everyone knows it. maybe you will tell me, Atom is a open source, you just work for it as volunteer. That make no sense, why you make efforts to a open source, because you love it. when you love it, why not keep it the best.
@lee-dohm, Then about the purpose, 200M, 100M? @crquan already gives us a good example ###sublime###. your words looks so ridiculous too, I have to say. no offence. Thanks.

anyway, Thanks all the efforts to ATOM. Thanks all you here. Thanks.

@fenec
Copy link

fenec commented Jul 14, 2017

Just installed it on my Mac. Gosh, it's 530 Mb...

@qcq
Copy link

qcq commented Jul 15, 2017

screen shot 2017-07-15 at 14 28 03

screen shot 2017-07-15 at 14 28 33

@brndd
Copy link

brndd commented Aug 23, 2017

Atom was taking up 1.5GiB (one and a half gibibytes) in my %APPDATA% folder on Windows 10. Because this goes on my OS SSD where space is very limited, I ended up uninstalling it. This is just ridicilous for a bloody text editor, but then again it's JavaScript.

@johnlanz
Copy link

Hey guys, Atom is taking 7GB on my SSD for 1 year of using it. Maybe its a problem after all?
atom7gb

@mathieu-jobin
Copy link

Adding to this, Atom was taking 5.5GB on my SSD as well, most of it in local appdata. Windows 10.

@ShalokShalom
Copy link

Just saying: VSCode is < 100 mb download size, ~ 200 mb memory print and also build up on Electron.

@50Wliu
Copy link
Contributor

50Wliu commented Sep 21, 2017

There is a known issue on Windows where the auto-updater may fail to remove old versions of Atom. It is safe to delete all the older versions.

@CallmeNezha
Copy link

I used to use atom a lot, and now it pushed me to vscode side, because obviously this HUGE beast become a problem~

@MichaelMacha
Copy link

I understand that Node.js style code must be transmitted as text, and 1.0 GB sounds reasonable for a piece of software with the versatility of Atom. Admittedly, I am also not a Node.js developer; I haven't used it in about a year and a half. However, I'm installing software on Mint 19 right now, and it's had to download an entire gigabyte.

Part of why I picked up Atom was because it was so much quicker and more lightweight than something like Visual Studio. Is there anyway you could perhaps take a machine-compiled portion of that code, and put it together as a binary on the host, then distribute it selectively? Something like binary, dev, and src packages? Because it is losing its original grace, and if this keeps up, I may have to switch.

@vitobotta
Copy link

I was searching about Atom's size and found this thread. I downloaded it from atom.io for my Mac and the app is a whopping 865MB!!! So is this normal? I was searching because I was afraid the download could have been compromised on the website or something like that...

How can a text editor take more than 800 MB of disk space?

@atom atom locked as too heated and limited conversation to collaborators Nov 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests