Is emacs large?
Expected goals
In this short essay, I shall try answering the question "Is GNU Emacs
a large editor?" I'm not that interested in functionality or memory
footprint, instead concentrating on disk footprint (that being the
most trivial measurement to get hard data on).
Methodology
We will identify all files needed to run GNU Emacs ("GNU Emacs
21.4.1", as distributed by Debian, including all conmpiled emacs-lisp
code). The chosen tool for this is du (for extracting file
size), find (for locating the .elc (compiled
emacs-lisp) files) and awk (for producing totals).
Types of emacs files
There's essentially three file types used by emacs.
- The binary itself
(in my case an ELF file, but depending on OS it might be an A.OUT or
other executable file format).
- .el files. This is uncompiled emacs-lisp source code and
can easily be edited.
- .elc files. This is byte-compiled emacs-lisp. In the
compilation process, the source is converted to byte-code runnable
inside the editor. There might also be some code transformation done
(various optimizations are possible).
Types of files for nvi and vim
In both cases, there's a central executable and assorted message
catalogs. In vim's case, there also seems to be quite a few other
assorted files, I shall blithely assume taht they are essential to the
installation.
Measurements for Eclipse
I don't use Eclipse myself, so I shall trust the Debian packagers to
have included what's needed. Since I'm not installing it, I can't
report the number of files, but I do have a "total size".
Disk footprints
| Editor | Subset | File count | Size |
| Vim | 1412 | 23856 KB |
| nvi | 11 | 452 KB |
| Emacs | binary | 1 | 4320 KB |
| Emacs | .el files | 876 | 31776 KB |
| Emacs | .elc files | 796 | 26984 KB |
| Emacs | total | 1673 | 63080 KB |
| Emacs | no .el | 797 | 31304 KB |
| Eclipse | N/A | 143 MB |
As we can see, emacs has a noticeably higher file count than Vim,
though the .el files are, strictly speaking, optional. Discounting
those, emacs clocks in at 797 files, a much lower count than Vim.
Emacs consumes much more data storage than vim, but (again) with the
.el files removed, it comes in at 31% larger rather than 164% larger.
Both emacs and Vim are rather stodgy, compared to nvi.
| Editor | Relative file count | Relative size |
| nvi | 1 | 1 |
| Emacs, with .el | 152.1 | 139.6 |
| Emacs, no .el | 72.5 | 69.3 |
| Vim | 128.4 | 52.8 |
| Eclipse | N/A | 316.4 |
As can see from the relative charts, an emacs without the emacs-lisp
source files (the ".el" files) is comparable in size to a Vim
installation and uses fewer inodes (fewer files, probably fewer
directories).
Conclusion
No, emacs is not a "small editor", of the three editors investigated,
nvi is by far the smallest. However, proponents of Vim do not have
much of a leg to stand on when they call emacs "large". By default,
the Debian GNU emacs package will not install the emacs-lisp code, so
it has fewer files than Vim, but requires a bit more storage in total.
So, what editor sould you use? The easy answer is whatever you're
comfortable with. A slightly more complicated answer is to try an
editor for at least a few weeks before saying it is unusable, because
it's so cryptic. Me, I use emacs and nvi and can now remove vim from
my machine, this test having been brought to conclusion.
Changes
- 2008-07-03 Some data on Eclipse, as this has been mentioned as a
"Might be nice" by some people.
- 2007-12-06 Changed "MB" to the correct "KB" (see previous version).
This is one of Ingvar's essays.
This is one of Ingvar's essays