What is the best text editor for opening large files?

A highly specific question, and unlike asking "what's the best text editor for programmers?", this one we can answer with almost 100% objectivity.

If you would rather watch a video on this subject, I've got that covered for you


To do this, we'll need to do some stress testing, so let's meet our competitiors.


Atom

It calls itself "A hackable text editor for the 21st century". Up until recently, this was my text editor of choice. Free and open source. It's only downside? Electron. It's not as light weight as I like in a text editor. These things should be speedy, with just enough features to get the job done. If I wanted something bloated, I would just use Xcode.

Now I'm not saying Atom is bloated. Absolutely not. In fact most of the text editors on this list are perfectly fine. It's just that, because Electron, you've already used up about 300mb of ram for just launching the app in an empty state. With no files loaded.

BBEdit

This is a popular choice for a lot of people and has been around for a very long time (like since the early 90s?). It's THE standard for which all editors should be compared.

Written in C, so it's a native app, and super light weight.

It's not free though, but very well priced. I also don't own this app myself so I used the trial version for my tests.

Sublime Text

I have used this app for many years. This was my number 1 text editor for a long time, and I'm sure that's the same for many other developers out there.

Nova

This is a fairly new text editor released by the same people who created Coda. Coda has been around for a long time, and was a great little editor you could use on iOS, mostly focussing on web development.

I've been using nova for a little while now and not entirely sure how I feel about it. It has replaced Sublime Text and Atom for most tasks, but I'm still working things out, and settling into a workflow that works for me.

Plus, it just looks really cool, if not a little distracting.

MacVim

Honestly? I've never used it since before writing this article. Vim isn't something that is ever even mentioned in iOS development. All we really need a text editor for is opening a few config, script, or JSON files and that's about it.

Vim has been around for a very long time (similar age to BBEdit?). But, this app was very performant, and I can certainly see the appeal, but it's just not for me.


Xcode

We all know Xcode. I'm not even going to bother with a screenshot here. This thing is a bloated mess. If you already have it open, and the text file you're editing is part of your project, then go for it.

However, for any smaller quick tasks, you could probably finish the job in any other editor before Xcode even opens.

TextEdit

Built into macOS this editor is just plain fine. It works. No syntax highlighting, or code completion. No addons. Just plain and simple.

I've known a lot of web developers who use this, day to day, and nothing else. How? I have no idea.

Hex Fiend

This app will open anything. Instantly. Full stop. Is this the best for opening large files?

Maybe.

Results

I know you skipped past everything just to get to this point, and that's okay. I would have done that too, and honestly, you didn't miss much.

What you will need to know though is that I ran these tests on a 2018 Mac mini, 3.2 Intel Core i7, with 32GB of RAM and an external RX 580 GPU. So take the times and usability with a big grain of salt. This is by no means scientific, and you computer may have a better time with this than mine.

This is the script I used to generate the 10GB file I used for testing. (Thanks to Bare Bones Software for helping me out on this). It came out to around 11GB in total. Line breaks every 100 characters, and ASCII text only.

export LC_ALL=C; dd if=/dev/urandom bs=1000000000 count=30 | tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' | fold -s -w 100 > ~/Desktop/10GB_text.txt

| App | Can Open | Time | Usable |
|---|---|---|---|---|
| Atom | ❌ | failed at 2min 48sec | N/A |
| BBEdit | ✅ | 9min 52sec | ❌ |
| Sublime Text | ❌ | 1hr 13min 24sec | N/A |
| Nova | ✅ | 10min 18sec | ❌ |
| MacVim | ✅ | 33sec | ❌ |
| Xcode | ✅ | 17min 57sec | ❌ |
| TextEdit | ❌ | N/A | ❌ |
| Hex Fiend | ✅ | Too fast to count | ✅ |

I... don't really have anything else to say about it. The results speak for themselves.
Is this useful? Maybe to someone out there.

What do I think?

The need for opening large files like this is rare. It's more likely you'll want to open a 1GB log file than a 10GB one. In those cases, speed does matter, and what I'd love to see is a compatibility mode built in to most text editors that will open up these larger files in the same way as Hex Fiend, without syntax highlighting or parsing.

Keep using your favorite editor, but install Hex Fiend as a nice little backup for those tricky files, even corrupt ones!