by toomanybeersies · 8y ago · 0 comments
I'm starting to get tired of how much of a resource hog Atom is.
90s me would be absolutely floored by a text editor needing 438MB RAM.
Wait, what am I saying? 2018 me is pretty flabbergasted by it, but perhaps less surprised (and more cynical) than 90s me.
That isn't RAM, that's 438MB of drive space. Even the compressed zip download for Atom is bigger than would have fit on that entire hard drive (Atom 1.24 is 123MB zip download).
Though the RAM usage is pretty close, with no files loaded it was using 360MB RAM here.
Some was.
WinAmp came out in 1997, 2.x was released in 1998. Real time streaming media.
Visual Studio 6 came out in 1998, had most of Intellisense up and running. The refactoring stuff wasn't there yet, but it could do remote debugging.
The Windows APIs were obtuse, but incredibly well documented.
It'd take a long time before a lot of things we take for granted got commoditized though. A streaming video player (+ server) was still an idea that a billion dollar company could be founded on.
It wouldn't have been hard to write a Slack competitor then. It wouldn't have had streaming video, and the client would have been native, but you could have gotten 80% of the functionality in there, and watched as people still complained it was just a fancy wrapper around IRC.
Web forums sucked though. Slashdot figured out the right idea, the entire conversation loaded at once, one big page, it took the rest of the web a lot time to catch up.
20 years later, I'm writing code, managing files, and have a chat app or two open. The monitor is higher res, and a lot larger. Hardware plug and play finally works, and printing is, on Windows at least, pretty much a solved problem. (Heck even Wi-Fi network printer works almost flawlessly!)
The APIs for writing code have gotten easier to use, but it seems like everyone's documentation is now 5, small, steps above garbage. Also APIs break more often nowadays.
My computer has dozens upon dozens of services running, most of which I don't know what they are. And individual websites take up more RAM than my entire OS used to.
That last part isn't even a joke. To load a few paragraphs of text, hundreds of megabytes of RAM.
It is cool that web browsers can natively play video. 99.9% of the time I don't want them to. I kinda just want that paragraph sitting in the <div id="content"> </div> tag.
I think this is true-ish.
But when I compare Blender (330MB) and 3ds Max (6GB) I got the feeling some software is just better constructed.
Using a web browser as a text editor might not be the best solution...
The most efficient software today is still built with the lower level mindset of conserving memory and increasing runtime performance (Browsers, Compilers, Vector Graphics, Games etc)
The simplicity of Win3.11 and Win95 was great, and that isn't just rose tinted glasses speaking.
This is a false dichotomy. Vanilla Emacs needs 38Mb on my machine, and it has all the tools you'd ever need to develop plugins for it. Visual debugger, byte-compiler, object inspector, jump to definition (including straight to C implementation when needed), visual font pickers, color palette, documentation browser & docstring viewer for symbol at point, you name it - it's all there.
Browser engines are not optimized for handling text editing. They are optimized for basically everything else but text editing. You can make them into kind-of OK text editors, but you have to put a lot of effort just to get to where text-editing frameworks are already[1]. And 200Mb of unnecessary code doesn't make getting there any easier.
To my mind, developing a text editor with a web browser is a bad technical decision. It may pay off in the number of devs available and eager to help - it may be worth it, I don't know, it's for the projects' leads to decide. Technically, though, these projects would be much better off with a text-editing framework.
[1] LightTable is a good example here. Well-funded, motivated team worked on it for a couple of years - and still failed to provide anything more than Emacs with plugins. Well, it looked a bit better.
Somehow I think it has more to do with developers not wanting to pay for software than anything else.
XAML coupled with Blend studio is a powerful UI design tool, or stuff like Adobe XD. HTML/CSS not really.
Right now Spotify is taking up 1 GB. VLC can play 4k with less RAM, what the hell?
To be fair, Lightroom and Photoshop have an excuse: dealing with 20+ MP photos is memory intensive. Atom doesn't: dealing with 2 MB text files is not hard.
Steam's minimum storage guideline says 70GB(!).
Not say Atom can't be more efficient, but I think this is often our field's "I remember when a cola was 10 cents".
From the OP:
> In Atom, the vast majority of computation of any given frame is spent manipulating the DOM, recalculating styles, and performing layout. To achieve good text rendering performance, it is critical that we bypass this overhead and take direct control over rendering. Like Alacritty and Xi, we plan to employ OpenGL to position quads that are mapped to glyph bitmaps in a texture atlas.
The problem with JS is that its execution model is built around highly dynamic features that are hard to compile efficiently. It also lacks a nice type system, though Typescript helps a lot.
The problem with Atom performance, I suspect, is mostly with its using a web browser and DOM to exit text. I bet that elisp is seriously slower than JS on v8, but Emacs is faster than Atom, because its presentation layer is more efficient (while less capable).
https://code.visualstudio.com/blogs/2017/10/03/terminal-rend...
Also Common Lisp (much faster than V8), Forth, and probably some Scheme implementations.
You'd lose type safety compared to Rust, but they don't have that with JS now anyway.
I don't think the majority of the memory consumption is from JS though, moreso the embedded browser+DOM approach.
Edit: Blaming electron for bloat more than JS.
True.
But there are also other dynamic languages that can go as fast as LuaJIT and of course faster than V8: Common Lisp and some Scheme implementations.
Both are very elegant languages, moreso than Lua (which is very peculiar.)
However, for the goals of an editor, my choice would be Free Pascal with Lazarus. It is already complete for cross-platform UI deployment. And compiled code is really fast.
And also Node.
I'm on emacs and firefox for good.
I remember when my Dad paid a small fortune for a 386 with a 27mb hard disk which was considered insanely huge amount of disk space at the time.