Text Editor Performance Comparison
github.com
github.com
It's also worth remarking on that some of the treatment of these two in this article is a little odd. Atom is excluded from a lot of tests completely, and Code is particularly penalised in one test for incomplete highlighting (where it's noted it completely the functional task "quickly").
I don't know the author's exact methodology, but it's possible that Atom just blew up for some tests, especially the bigger ones.
When I have to look at a large log file, I just use vim or grep with context.
There's a lot to like about the new editors, but it's a pretty big tradeoff, IMHO. Even on reasonable-sized files, I notice the speed difference, and sometimes Atom or VS Code do something pathological and end up making me wait an inordinate amount of time for it to sort itself out.
Also, Atom has improved quite a bit. It used to be remarkably slower than VS Code, and now it seems to be only marginally slower (though both are among the slowest in this bunch of tests, so it's faint praise to say Atom is "almost as fast as VS Code"). Nonetheless, Moore's law has given us a world in which even very, very, slow editors are Fast Enough(tm) for most of the work, most of the time.
"vim.otherModesKeyBindingsNonRecursive": [{
"before": [";"],
"after": [":"]
}]
This, placed in settings.json, does what you requested.So...yeah, I use Atom and VS Code mostly stock, with a few plugins. I don't ask them to act like vim. I'd just be disappointed.
How do you do this in vim? Could you give an example?
I've tried a few times to love vim but emacs keeps pulling me back.
:%s/word1\(.*\)word2$/word3\1word4/
Over each line in the whole file, search for word 1 and word 2 (which is at the end of the file), separated by arbitrary non-newline characters, and change them to word3 and word4.
M-x replace-regexp word1\(.*\)word2$ RET word3\1word4 RET
Assuming you have `replace-regexp` bound to a key, it's practically the same. Works on the whole buffer (by default), or the region (if selected).I don't really try to convince people that vim is better than any other thing. I get the appeal of things like Atom and VS Code and Sublime. vim was just the first really power editor I learned really well (on an Amiga, no less), and it's pretty ingrained (and I barely tap into its power...I used it pretty close to stock, and have no clue how to do tons of things without googling it), but it's very fast, for me. Heck, I don't even use hjkl cursor movement most of the time. I grew up on a keyboard with arrow keys, so that's what I reach for. I'm a sloppy vim user, but it's still more productive for me than other editors in many contexts.
If you are lucky enough to use linux on both ends, sshfa can make your life so much easier.
The development with web technologies means a big step forward in accessibility and usability and that's much more important to me.
For the rare case I do need to work on an XML with 100k lines, vim is still around and using a modern editor won't make it disappear.
Perhaps I'm just a 'sensitive' soul, but I really do notice these minor differences in performance. If there is ever a slight slow down in the editor then it takes my focus off my work and onto the editor.
I 'feel it', rather than being able to put it down into specific testable specifics.
I use ST3 mostly and I instantly notice if switching tabs is taking fractionally longer or if undos/redos or scrolling is taking longer.
The only reason I don't switch to Vim is that ST3 is much more user friendly. So it means that I have to think too much about the commands in Vim which slows down my thinking - which is the equivalent slow down of having unresponsive editors.
If you use anything long enough, you no longer think about it. Indeed, the only time I think about how I do things in Vim is when someone asks "How did you do that?" I only thought it, and it happened. Recreating it can sometimes be a short puzzle.
I'm certain this is true for other people and their editors, or anything that you use so intrinsically that it's like breathing.
All editors from Notepad to ST / Atom, Browsers and Document editors have the same keys for search, replace, new tab, close tab, new document.
But learning vim is a completely different language. I mean that in the sense of actually learning a spoken language. Until you're fluent in it, it's really awkward.
My latest step has been finally to get round to using tabs which I'd never even really considered for Vim. But even that requires learning all the new tab commands, there's no Ctrl + Tab and Ctrl + Shift + Tab.
I'm in the Windows world which doesn't help with learning Vim as it's just not as pleasant experience as using it in the Linux command prompt.
For example, in order to make vim an alternativet to ST, I have to use several plugins, such as snippets, youcompleteme, etc.. Once I do that, vim has a slight delay that I just can't stand.
Around the first release, there was noticeable lag as I typed. About a year later, tabbing through find results was just absurdly slow. More recently, opening a multi-megabyte JSON file with syntax highlighting was an inexcusably painful experience.
I really, really want to use and support Atom, but the performance compared to Sublime has just been atrocious (in my experience).
I wouldn't use it for really large files, however. It really shows its ass in those cases (as the XML file test here shows).
My current performance complaints are: startup time, big files (especially big files with highlighting), selecting large blocks of text (spanning more than a screen), and probably some other things I can't think of right now. Some of the plugins are buggy and prone to screwing up more than just the thing they're supposed to changing, but that's not performance-related. Just immature code that's expected of new-ish projects.
The ability to take contributions from the community is much better, as well. Far more people can competently write JavaScript (or with Atom, coffeescript) than C++.
Plenty of valid uses for non-text rendering, especially in the realm of plugins.
IMO a browser is a perfect platform for a text editor, because you get so much shit for free, and it's done right across most major platforms.
Or you can do most of that on your own across most platforms and hope your version is faster...
>What about easy theming?
That's a particular cancer that needs to die, themeing is the OS job, not the apps. You're themed electron apps look ugly and out of place on my desktop.
on the other hand you had "works on windows 7 only", or "we created our own language to do this, so learn that before you contribute"
Like them or not, browsers have nailed a lot of those things, and for good reason (after all, that's all they do). They made them work well, work consistently, work cross platform, work with a great UX, and work pretty damn fast.
>That's a particular cancer that needs to die
Well this comment took a turn! Call it vain, call it stupid, call it whatever, but a good looking UI is a big point for my editor. I stare at this thing for many hours a day, I want it to look good, have a good (preferably customizable) set of colors both in the editor and in it's syntax, and I want to be able to fully customize every single part of it (I like to have my "file tree" take up the bottom half of a sidebar and the "minimap" take up the top half. I'm not going to be able to do that in sublime, in atom it's 10 lines of CSS in a config file that gets synced to all my computers I run it on).
You can say it's the "OS's job" but the OS doesn't allow that kind of customizability either. It's one of the main reasons why I and many others use an editor like Atom.
You don't need to use it or even like it, but it's not like they are doing something "wrong", it's just not for your use case. There are many people out there very happy with the workflows that atom works great with, just like how there are many others that are happy with a workflow in vim. The 2 can coexist and have different goals, features, workflows, and users without any issues. And calling a feature that you don't like a "cancer that needs to die" is silly at best. I'm sure there are many out there that see reimplementing another text renderer a pointless exercise, but that doesn't mean it's wrong in all cases.
It's vain and stupid but I agree completely, I want it to look great too. But I want my whole desktop (gnome at the moment) to look great and it does. All the apps I use regularly have a consistent theme and widget set across the whole desktop that looks great. And with a few button clicks I can change the style across every app. This kind of consistency is how apple got it's reputation, even windows was like this not to long ago. But browsers think they're special, no major browser (except maybe safari) looks native on any platform.
>on the other hand you had "works on windows 7 only", or "we created our own language to do this, so learn that before you contribute"
"Only on windows" I'm fine with that, there's nothing wrong with a piece of software being for a specific platform, I'd say the software that does is generally much higher quality, they aren't chasing the lowest common denominator. This may vary from app to app, but creating UI's is not hard, there is nothing wrong with creating 2 or 3 of them, or only one instead of 3 half assed ones.
Does it have any features which emacs — which outperforms it — lacks?
It's not as well integrated and there are some rough edges, but it's incredibly useful. I use it a lot. Often for quick local refactoring, but also for larger things like you mentioned.
And also keyboard macros, which are more often used for the use case you mention.
What's NOT super-fast is editing files with super-long lines (it doesn't even have to be a "big" file). For whatever technical reason, that can grind Emacs to a halt.
I'd love to see that bug fixed myself.
I hope this trend dies soon. The inmates are running the asylum.
Also, at first I wondered why vi wasn't on there, but for those of you who thought the same, nvi is berkely vi (TIL).
I like that emacs performs in the middle of the road in most of these cases, because it shows stability but room for improvement. Dissapointed with the large file results, but they are useful. (using vi on big files from now, it's a problem I run into more and more)
There's also addon tools like vlfi if you're editing very large files on a regular basis.
I'd be more interested in ~200MB instead of 3 GB as I find myself more frequently opening log files and XML exports in the 100-500MB range.
I don't tend to open files in excess of 100MiB, or do more than about 20k replaces in a file interactively, so I never really notice latency on operations.
Its actually awesome - I only stopped because my wrists..
But fear not, not everyone has those issues. Mine diminish if I go to the gym...
The importance is that things like 'magit-status be instantaneously snappy to open, which currently leaves a lot to be desired.
And I also use emacsclient, which make it just instant.
However I've had no difficulty using it to view 3GByte files with 80-column lines. I don't have one handy to try but I did quickly load a 450MByte text file (6m lines, most 76 chars) and it took about 3 seconds to load.
i dream of an editor with the flexibility of emacs that but the bug-freeness and speed of sublime. :)
Also an option: C-x [ (backward-page) and C-x ] (forward-page) to move between occurrences of ^L (ASCII 12 - you can enter it in a buffer with C-q C-l).
Come on emacs, other editors can handle them! :)
I also have the following function in my .zshrc to disable "word wrap", specifically for when I need to read large log files that may have very long lines:
emacsr () {
emacs -nw "$1" --eval '(progn (setq buffer-read-only t) (setq truncate-lines t))'
}
I haven't noticed if it makes loading the files much faster (the lines aren't that long), but definitely makes it easier to read them in a terminal.https://www.gnu.org/software/emacs/manual/html_node/elisp/Pr...
https://www.emacswiki.org/emacs/EmacsNativeProfiler
Also, ESUP for profiling your startup time:
https://github.com/jschaf/esup
There's also a second profiler in Emacs, ELP, which can be used for testing individual functions:
Which is very unfortunate as atom is a rather nice editor from most other points of views.
That being said I've yet to find a good IDE even that holds up to being used in a workspace with the kernel and AOSP.
Nobody normally starts an Emacs instance to edit a file and quits it afterwards. Typically you run Emacs in server mode, and use emacsclient to instantly open whatever files you need.
By the same token, somebody could give low marks to IntelliJ or Eclipse because it may take a good 20-30 seconds for them to load.
The line between editor and IDE is getting more blurred every day.
I use Atom. It gets opened once a day and closed at the end of the day. It could take minutes to start for all I care. The amount of time saved by having the vast set of plugins, the customization, the tools, and more greatly exceed any kind of savings I'd get from faster startup time. People tell me how I'm wrong because my editor shouldn't use so much memory, I try to tell them that I'm more than happy with the memory usage for what I get and it runs fantastically on my computer.
But at the same time, I use nano on remote machines for quick edits all the time. If it were slow to start, it'd be useless.
And again if I were using an older PC with 4gb of ram and a 5400RPM HDD I might feel that the performance of atom is an issue, so I'd probably use something else.
I'm glad there are so many options that all focus on different workflows and features. Just because one doesn't focus on the workflow you use doesn't make it wrong or worse, just worse for you.
Is that seriously worth a >10x slow down to you?
These benchmarks on a modern i3/i5 processors and with 8GB of ram, which is almost the standard now, wont give those slow numbers published.
also, I'm pretty sure VSCode at least have gained way more performance that you wouldn't notice these "lags".
I don't think that's true at all. My personal experience using both VSCode and Atom on my i7-6700k/16GB work machine has mirrored these results. Files over 30-40k lines simply crash the program.
This is on a late 2015 MBP with 16GB RAM. On my prior machine, with the same daily behavior, I still never experienced performance problems in VSCode.
I used to use ST2 & ST3. Bought both. I just don't find a compelling case for it given the huge and active extension community for VSCode.
Slack, however, frequently has performance problems.
I also don't open files regularly that exceed 4-digit line counts.
I'm a Sublime user myself but I'm not blind to the appeal of other editors.
Speaking to VS Code here, I am yet to feel that '10x slow down', one bit, so yes it's absolutely worth it.
(I don't hand-edit 5.62 MB XML files often).
Planning on switching to VS Code full-time as soon as I can figure out how to add a couple of simple bindings to (custom) things I have setup in Vim.
It's snappy as hell for me, on a mid-range Mac Mini. Really impressed with the Vim mode, which includes things like tab support which other projects (like SpaceMacs) don't.
Granted startup time takes about 10 seconds, but then my iTerm startup time is pretty similar on this machine, so that doesn't bother me. Once my editor is open I'm going to leave it open all day (and ditch my Vim habits of perpetual ctrl-z/fg).
I think my biggest VS Code complaint right now is it seems to hide tabs away once I have like 3-5 open. Is there a way to get it to shrink tabs (like browsers/sublime) to have them all open and visible?
The rumors surrounding Sublime's demise have been wrong in the past, and the trend continues.
I think Sublime Text would benefit from you and Jon being more active in communicating what's going on and what's on the road map. Perhaps someone else could help you, but the information still has to leave the silo of the core team.
I just think there is a need for more formal venues, such as a regularly updated roadmap.
Jon has never published a roadmap. If you think Sublime Text is dead because it doesn't have a public roadmap, then I'm not sure how to convince you otherwise. I mean, we did over 20 releases in 2016, with over 50k lines of syntax definitions and tests published on GitHub.
By the way, if you are a Sublime Text user, I'd love to get some feedback and bug reports on our Erlang syntax! We don't seem to have many Erlang users, but I'm sure the syntax could use some improvements.
I've thought about contributing to the Erlang syntax a couple of times. Is a rewrite in the new syntax format of any interest or do you want to keep compatibility with TextMate still?
We no longer keep compatibility with TextMate in any of the default syntaxes. Everything is now a .sublime-syntax, and has access to all of the advanced stack and scope manipulation features.
If you are interested in providing feedback, the packages are at https://github.com/sublimehq/Packages. Tests could be helpful, even if failing. The test syntax is described at http://www.sublimetext.com/docs/3/syntax.html#testing and scope naming guidelines at http://www.sublimetext.com/docs/3/scope_naming.html.
Mostly working with reasonably sized files, there's almost never a perceptible delay in anything except initial startup. A 10× speedup in the editor (which isn't the limiting factor) would have basically no value, so it's not worth compromising anything to get it.
That said, there are things I prefer, e.g., full IDEs or more specialized editors for, but almost never is it because Code or Atom is too slow.
With atom and vscode i have lots of Devs, a big company behind it, and the source. I'm sure they will continue to exist.
Sublime Text has now existed as publicly available for nine years now. In general I think the track record for continued development and improvements is fairly evident if you look.
Don't get me wrong, sublime is a great piece of software. I wish it had, like QT used to, the source in escrow, to be released under GPL or BSD if a nominated independent person decides the software is ever "abandoned". I've been burnt once too often by abandoned software.
Wow, interesting. I was aware of Qt's early history of being fully closed, but I didn't know it was in escrow like that. Link from wikipedia: https://www.kde.org/community/whatiskde/kdefreeqt_announceme...
Here's an example of another non-OSS program with source under escrow: https://fman.io/blog/transparency/#open-source-promise
I use sublime & atom both at home (OS X) and at work (Windows) and atom is much closer in terms of performance on my home machine. I think the faster SSD & lack of anti-virus crud count for a lot in terms of how fast atom can open files which for me is the most noticeable performance difference.
In sublime for installing a package I do this: Ctrl+shift+P, type 'inpa' Enter (selects install package), type first letters of name of package (emmet for example), hit enter.
I don't even need to use the mouse. I fail to see how the Atom method is 'much' simpler.
Most of the time, the difference in performance is insignificant.
[0]: http://acme.cat-v.org/ [1]: https://github.com/9fans/plan9port
This confirms my observations that Atom is both significantly slower and also consumes more resources. I mean, the numbers speak for themselves: It uses at least an order of magnitude more RAM compared to most of the others, and common tasks are up to two orders of magnitude slower.
At first I thought the issue was my old laptop. But now I see the benchmarks, I'm definitely switching back to ST3.
I don't like the fact that Atom and VSCode are slow and memory hogs. I do like that fact they are running in a cross platform environment with access to canvas, webgl, svg, images, video, networking and more. I want to see where that integration leads. Whether it's inline diagrams or code flow diagrams in a separate pane or ???
I also like the idea that editors could be written to be more friendly to plugins and customization than previous editors. I get that emacs and vim can be customized but there is arguably room for improvement. Whether it's easier APIs, an in editor plugin browser/installer, or things like Microsoft's external code meta data protocol that potentially let's more editors share support for more languages.
Of course I want speed and I have not switched to either Atom or VScode yet but both seem like a step forward where as emacs, vim, and even sublime feel stuck in a previous generation of design
My view is biased, I'm in a lexicalist period (blame it on sml) where I want a few equations, type constraints etc and no visual flexibility (which I wanted in the past).
You give up a bit of flexibility for more stability and overall polish.
That seems like a fair point.
There is, of course, always room for improvement, but I think you are selling Emacs short here. Emacs is roughly 85% lisp, which is what you write to extend it. Not only do you have access to everything the core parts of the editor have access to, you can jump to the source of any editor function to see how it works. Since most of it is written in Lisp, you can assume that it has been dogfooded to death. Lisp is very much a first class citizen. And practically every public function is documented, and that documentation is just a keystroke away (C-h f).
When you launch Emacs with no filename it even dumps you into the "scratch" buffer, which is really just a lisp repl. Everything about Emacs is geared toward not just customization, but full on extensibility.
Emacs also now has all the stuff you'd expect—browsing, downloading, upgrading extensions (called "packages"). It also supports customizing the editor without writing any lisp code (M-x customize-*) if you don't want to be forced to learn lisp right away.
Everything else is userspace load. There's no reason why the same code on the same processor running in a straight line would perform any differently.
It seems to be available for Windows and OSX, but I haven't tried it on those platforms. Does anyone have any experience with that?
I suspect it's perceived as KDE-specific, which might be part of the reason it doesn't get more attention.
/me waits for someone to say we shouldn't have 3GB xml files in the first place, like I don't know that already.
I did some of these tests with Howl, here are the better numbers:
- Memory (hello.c): 22748 (RSS)
- Rehighlight test: about 3s
- Time used to load test.xml, jump to end of file and exit: 2.1s
I find Lua much more pleasant than Lisp. It is also performs significantly better. This could result in a very nice editor if enough people embrace it.
Github page for the lazy: https://github.com/howl-editor/howl
You are right, but the default vim is not that great either...
For example if you use something like vim-plug[1] (amongst many plugin managers) then you can use on-demand loading to make keep start up times lean.
IntelliJ is my daily driver, but god it's slow for me. I can't figure it out. It's OK, on my laptop, but when I plugin an external display it's performance tanks.
A large C or json file would be a good test case to add.
(Also, as someone else mentioned, the 3GB file also had rather long lines, some of these editors that failed on that file can handle 3GB files with ~100 character lines.)
Most of the editors inside of an electron shell have slow start-up and file opening times but everything else should be pretty quick.
My point is that some aspects of it, typically ones you do once or a small amount of times, are the points in which it is slow. The performance after those points isn't bad and I've never seen laggy or sluggish scrolling or text input (or at least I hadn't noticed it).
But feature wise, it's still way ahead of Atom.
Atom has memory balloon when loading test.xml without highlighting, takes 4x as long as Code to rehighlight, simple search and replace basically doesn't terminate.
They are both terrible but at least Code doesn't seem to hit any degenerate cases.
TBH this benchmark is not fair for editors that have constant updates like VSCode and Atom, unless they keep up to date the results.
https://code.visualstudio.com/blogs/2017/02/08/syntax-highli...
FOSS
1000s (millions?) of plugins
RAM/hardware is cheap e.g it works fine on latest generation top of the line hardware.
No one should need files more than couple of thousand lines long.
Commit messages load up painfully slowly, however. Again, I just use a different editor, but I would love to hear any fixes for this (tried many).
To make the comparisons fair, the table should also include whether the editor highlights (and indexes) the file using a proper parser instead of just line-by-line regex.
More realistic hardware would also be interesting. He doesn't even have SSD...
I am not really seeing the performance issues others are. I use it on a 1st generation i5 laptop with 4GB ram on Ubuntu, and in an Ubuntu VM on Windows 7, so I'm doing alright on low end hardware.
When I have to open very large files, it is usually log files on a server and I tend to us grep and tail etc...
Unfortunately this doesn't measure this basic "redraw" performance.
Maximized, it's even worse - typing is very slow. But that's apparently some sort of bug.
Presumably a top-end desktop processor (~4GHz) and latest-generation NVME storage would offer really good performance, but perhaps not.
If I had to guess, the average setup is probably a mobile processor paired with a traditional SSD.
Edit: Also moving around test.xml doesn't take 22 seconds, it's pretty much instantaneous, although replace is still slow.
I don't care how much memory a text editor uses so long as it does what I need.
What I would be interested in would be time from keystroke to screen, scrolling, etc.
In the same file? Holy crap...
Sorry if I sound like a shill, but no one seems to know of it and I simply love it's speed.
Editors using ropes should have fast edits, but may have slow navigation after lots of edits.
Also, mg is starting to grow on me. I think it should replace nano and vi as the default unix editors.
If I ever need something larger than that, odds are I'm using an editor geared towards larger files... different experience for different situations.
vscode works very very well for doing what it was intended for. I love using it for web and golang projects. If my work required me to edit 3GB files however I would use something else, probably not a generic text editor.
Note, I'm not saying that the more featureful editors aren't worth the trade off in performance. Just that there is a point where it wouldn't be a good trade. I use both Atom and VS Code (trying to figure out which I like better) for my more complex projects (a lot of files/deps/etc) that I can test locally. But, fall back to vim for quick changes on single files and whenever I'm testing-editing-committing on a remote machine or VM. It's a feature that vim starts instantly, wherever I am. It's a feature that it's still fast(ish) even over a slow(ish) network. A killer features in this case...I can't use Atom or VS Code, at all, on a remote server over a slow link. Literally impossible to do.
So, why not compare a bunch of different editors with wildly different capabilities, if it provides insight into the relative performance and sizes of the editors? And, to be fair, some of the fast/light editors are roughly as capable as VS Code, Atom, or Sublime. vim and Emacs are plenty powerful editors with huge ecosystems of additional functionality. I understand the appeal of a good GUI, and the bigger/slower editors do have superior UI to vim or emacs, but it's just one feature of many we can compare.
Or comparing Vim against Sublime for loading large files, when Sublime needs to draw the very fine and useful minimap but Vim doesn't?
In addition, most of these perf tests are extreme cases, whereas some editors are optimizing for more common use cases.
It doesn't have to be fair to be useful and interesting. Software doesn't have feelings, so we can judge it on all sorts of metrics, fair and otherwise, without causing harm. Performance is a feature I value. So are some of the other things the bigger slower editors do. Having real metrics about their relative differences is useful, IMHO.
I looked into text editors for handing very large files several years ago. For your perusal my results, hopefully not too outdated: [0]
.
SOME USEFUL SPECS to consider
* Performs with %yourmemorycapacity% and %yourdiskthroughput%
* Optionally disable features that multiply required memory capacity and disk capacity & throughput: Auto-backup, temp files, auto-conversion to different character encodings (e.g., 8-bit to 16-bit)
* Optionally disable parsing of data (for any purpose, from syntax highlighting to structured data)
* Load subset of file into memory at any one time
* Begin editing before file fully loaded
.
SOME USEFUL RESOURCES
* http://texteditors.org/cgi-bin/wiki.pl?CategoryLargeFileHand...
* http://www.knudvaneeden.com/links/file/addactivity/computer/...
.
SOME USEFUL SOLUTIONS
* EmEditor: This was very impressive. The speed is breathtaking for what it does, and it can handle advanced functions such as column operations on the full file with ease. We chose this and users were very happy; it transformed their abilty to work with large text files.
----
These were on our shortlist to test next but we didn't get to them due to available time and EmEditor's fantastic results:
* VEDIT: Designed for large files. They charge for it, IIRC, but based on its reputation it is worth the investment.
* The Semware Editor (TSE): Also a great reputation
* 010 Editor: http://www.sweetscape.com/010editor/
* PilotEdit: http://www.pilotedit.com/
----
Also of interest:
* File Query: Treats file as a database, enabling parsing, queries; very flexible and powerful, per reviews: http://www.agiledatasoftware.com/
* PDT-Windows: A database editor which reputedly has a max filesize of 18 EB (exabytes)
* bvi: Binary VI
[0] Some of this is copied from an earlier HN comment of mine
Why even bother making a swap partition if its going to be that small