Atom: Editor window startup is slow
github.com
github.com
1. The slow startup time in question
2. The huge editor software file size. I am not leaving 400mb for "yet another text editor"
3. I had become very dependent on some Sublime plugins for my work and the Atom counterparts were a long ways off being up to par.
The thing that first made me excited about atom was that being built around Chromium I thought we could finally have an editor with a nice Chrome-like web view with real-time update built into it, as a tab or something.
However, I noticed a thread on it in Atom (can't find it now), and it sounded like the core of Atom's security prevented such a thing from ever being built, so it would remain an unfulfilled desire. Oh well.
I closed Atom and my memory pressure dropped considerably. Installed Brackets and the pressure is still low even with Chrome and a box running yet.
This probably isn't an issue for people with 8+ GB of ram though, unless it actually has a memory leak.
Honestly, nobody who adopted Atom should ever be surprised by any single aspect of its sluggishness.
> 2. The huge editor software file size. I am not leaving
> 400mb for "yet another text editor"
I don't know why you'd care about this, besides reasons of dogmatic principle. Disk is the cheapest thing in the world. Any benefit that can be had at the cost of larger artifact size, especially for things like consumer applications, should be taken, IMO.Apple's Macbook SSD upgrades are quite a bit more expensive than you're positing.
I am pretty economical with space, I don't store media on here, it's almost entirely dev tools and code projects. And I do not want a piece of software that takes 400mb without providing me significantly more value than what my 30mb (Sublime Text) one. I don't care about media being large, or backups taking a lot of space, or installers being big, since I can shove those on an external.
But I'm obviously not going to do that with any dev tools. Any tool that cannot justify it's size cannot live on my internal drive, and if it ain't there I'm not using it.
https://github.com/atom/atom/issues/2654#issuecomment-501372...
No I wouldn't. What features do IDEs have which makes "a few minutes" a forgivable startup time (which I'll arbitrarily define as "time until key presses cause characters to show up on screen")
Especially in a world where Web apps are "slow" if they take a few seconds to load, and a bunch of work is going into replacing OS init systems to get their boot times under 10 seconds.
I didn't forgive Eclipse and Netbeans for their slugishness and bloat (they're the only programs I've seen with progress bars for exiting!). I've since switched to Emacs, which straddles the divide between text-editor, IDE and operating system.
Even loaded with extensions, written in LISP, running in a single thread, it loads in a few seconds.
Some tools take a while to warm up, use them or don't.
I'm pretty happy in Emacs. I'm not happy with false dichotomies, like this features/speed tradeoff. There is a real tradeoff to be made between those, but nowhere near the level I've seen in IDEs.
Many problems seem to depend on the way modules/extensions are implemented.
For example, we could implement plugins by allowing event listeners which can run arbitrary, imperative code. However, this leads to redundant computation (multiple "get(foo);" and "set(foo, bar)" calls spread across listeners), increases the chance of plugins conflicting due to race conditions, requiring very conservative scheduling, etc.
An alternative, like a hook/advice system, would have the core performing gets/sets exactly when they're needed, but give plugins the ability to override the return values using hooks (like a dynamic form of decorators). This avoids the redundancy, race conditions and scheduling issues.
I just ran 2008 and 2012 and the second time they load (I prewarmed the caches), they load in about 1 second. With a cold cache 2008 takes 2 seconds although 2012 seems to take 15 seconds (which is slow.)
(Tested on a fairly high end machine, you results may differ.)
EDIT:
I'm on a brand new macbook pro with 16gb ram and a 512gb ssd and it takes 2 seconds. It takes about 10 seconds on my old chromebook.
OK I see your edit now
Next I tried rearranging the tabs around and it took seconds? for the drop of the drag-n-drop motion to register.
This is why I lol about everything being re-invented in the browser and rewritten in javascript. Just because you can doesn't mean you should.
Not seeing that, at all. What you've described just sounds like the default delay OSX puts on tap/three-finger drag motions though.
Why was that technology stack used to develop Atom? A browser window to render a text editor?
If Atom wanted to take over the world, it should have chosen a technology stack that made it run AT LEAST as quick as Sublime Text. Instead we got Eclipse. Therefore, it's never going to get traction outside a niche.
LESSON LEARNED: Choose a technology stack that benefits the end user, not one that suits the developer of the software.
Even Emacs is smaller, and it's just as if not more customisable/featureful.
Here is a nice rebuttal to that "premature optimisation" myth: http://ubiquity.acm.org/article.cfm?id=1513451
From personal experience, by the time a system gets too big/slow, the inefficiency is usually distributed throughout so that it becomes more difficult to single out one component that's causing it, and there is no easy way to optimise such a system short of redesigning and rewriting it - it can be said that the problem is because "the whole is bigger than the sum of its parts."
Startup speed matters, sometimes a lot, sometimes not so much. It is both interesting because optimizations are a common problem in our field and the different approaches that can be taken are interesting to discuss, but it is also interesting taking a look at how this particular project cares about startup speed and what they have decided to prioritize over it (the social / project management aspect).
With that in mind, if they didn't have those optimizations, Atom would probably be an order of magnitude slower to start up than it is today. It's all a matter of non-functional requirements and priorities, I guess.
On the other hand: as the saying goes, "make it work, make it pretty, make it fast" - which can be interpreted in various ways, like "working software is more important than fast software" (aka avoid premature optimization), and "a well-designed application is easy to optimize".
OT: I've not actually heard that stated before. I've seen "make it work, make it work correctly, (if you have the time) make it work fast"
Maybe I shouldn't be allowed near front-end stuff ;)
But I have always put it off:
- The performance challenges are daunting. For complicated, heavily data-oriented UIs like Atom's that require low latency and efficient memory usage, it's nowhere close to native.
- I'm growing increasingly tired of dynamically typed languages. What I want is to be able to implement native GUI code in a fast, statically typed language (ObjC is fine for this); and then write high-level logic in a scripting-type language. But:
- The divide between native (ie., the shell) code and app code is very hard. Atom Shell actually relies on a special IPC mechanism to let the JS code talk to the native shell, and all the IPC calls have to implemented manually [1]. Surprisingly, there isn't anything like MacRuby/RubyMotion's Cocoa bridge.
I'm intimately familiar with ObjC/Cocoa, and it's a great language and framework, but I feel like as UI framework go, it's a bit antiquated; the "amount of code to productive, visible UI effect" ratio is very high. Way too little of my code ends up being actual app code, and way too much ends up being non-reusable, hand-coded, pixel-perfect-tuned logic to handle things like reshuffling UI components with animation. As a former Delphi developer, it's amazing to me that GUI development is actually harder today than it was in 1998.
Just look at Shoes [2] for how simple a UI framework could be. It's not something I would/could use myself, but it certainly gets a bunch of things right.
[1] https://github.com/atom/atom-shell/blob/master/atom/browser/...
$ sudo ps_mem
Private + Shared = RAM used Program
[...]
412.0 KiB + 137.5 KiB = 549.5 KiB vi
[...]
12.2 MiB + 2.7 MiB = 14.9 MiB gvim
[...]
968.9 MiB + 94.3 MiB = 1.0 GiB atom (7)
That's with no file loaded in any of the editors, gvim brimming with plugins, Atom freshly installed.
Sad, really.Would it be possible to immediately 'show' something (ideally the content of the file) until the whole editor/browser runtime starts up?
Or have an on computer startup process (yuck), that basically warms the atom cache for you. I know Microsoft Office does this or did this.
Therefore saying that you should use a software in a certain way is not really a good argument. It's possible to adapt the software to the user.
How often do you start up an editor per day? If the editor offers tools that save you more time than that, you won.
It's like refusing to use a chainsaw instead of a handsaw because it's a 2 minute walk to get it.
EDIT: I talked before my turn. I thought this was just about initial startup, but apparently it's about each editor window. Thanks schrodinger.
If it was just the initial startup, I'd be compelled to agree with you.
That's what I came here to mention. I've been using Atom as my primary editor for a month or so now, and I've never noticed the slowness.
After I read this post, I did a test:
Launching a file when the editor isn't in memory:
> atom filename.js
This takes around 4 seconds on my Mac Air.
Launching a file when the editor is in memory:
> atom filename2.js
This second one takes < 1 second.
I could see the OP having a point if the _second_ version was taking a while: this would be the equivalent of opening a new browser tab in 4 seconds. But opening an entire browser in < 1 second? I don't really expect that on my mac.
The user expect it to open in the blink of an eye, no matter what, and it can be done for this kind of program as alternatives in the same league show. If it isn't possible at all with the underlying technology, that was a bad technological choice. However I wouldn't worry so soon, there is a lot of space to optimize, the project is young.
Ok, let's try another one:
Atom is an IDE like XCode is an IDE. I don't expect XCode to start up "in the blink of an eye" although I do expect opening a _file_ to take a blink of an eye.
That is the behavior I reported: Atom itself doesn't start up quickly, but loading a new file/window is < 1 second, which I what I'd expect from any editor.
So again, I don't see the issue the OP is referring to. Not to say it isn't there on other machines/configurations, but it isn't an issue for me.
Probably 50 to 100 times.
Also it's not just the startup time, atom in general is slow but most of the work being done is on the speed of the editor and not startup time. While I do agree that the actual functionality is more important than startup, it seems like they don't really care about the startup time at all.
Well, the issue submitter wrote:
> I usually open Atom using the Shell command "atom [filename]"
So it might be that he opens up the editor many times a day.
Anyway, I don't think asking for a snappy editor start up time is much to ask for, in this day and age. And if some editor doesn't offer that, there are enough other editors that will offer fast start up time as well as features that are associated with power editors.
I sometimes can start up my editor (Emacs) many times a day. Maybe I have an Emacs up for some editing on one workspace, but I need to open it in another workspace, because it fits better in that workspace. Not to mention that some programs uses my $EDITOR variable to launch Emacs when I need to edit something. That's another program start up, and I'll be damned if I have to wait 2 minutes to edit for my editor to start up just so that I can edit a git commit message.
In my case, I guess I might be able to set up an Emacs daemon, if start up time and stuff like that is ever an issue (what isn't possible in Emacs, with enough effort?). But if any editor offers something like that as a solution so slow start up times, it better be straightforward to set up.
Open another window of the same editor (a frame): File, New Frame or C-x 5 2 and then move it to another workspace. This seems quicker and more efficient than opening the whole editor again but maybe this isn't faster in your setup.
Emacs starts a server if you include (server-start) in the .emacs file. Then you can open files in that emacs like this $ emacsclient -n file I have a alias ec="emacslient -n" in my .bashrc The -n is to make the command terminate without waiting for the buffer to be closed in emacs. Maybe you want to do without the -n if you use emacs inside other programs (e.g. for editing the log messages in git) but I usually use vi for quick edits.
Unfortunately running two emacs with one server each doesn't ends well so the emacs server is almost bound to using new frames in multiple workspaces.