Features, Requires, and Autoloads

Emacs Elements has a really excellent video on features, requires, and autoloads. The putative subject is speeding up the Emacs load process and perhaps even Emacs itself. The idea is that if, like me and Emacs Elements, you have a lot of specialized functions in your init.el or .emacs, you can extract them out to separate files that you can byte compile and perhaps set to autoload.

The autoloading will speed up your Emacs load time, of course, but even when you must require the file, byte compiling it will make Emacs run faster. The video explains how to set all this up. It turns out to be simple to configure and maintain.

The first step is to run emacs-init-time to find out how long Emacs is taking to load. That may or may not be useful. For example, my configuration involves decrypting and loading my authinfo file so my load time includes waiting for me to react to the password prompt and the time it takes me to enter it. You can solve this by loading Emacs twice in a row but regardless, if you think Emacs should show a bit more alacrity during loading, this video shows you some easy ways of accomplishing that.

Any reasonably experienced Emacs user knows about require and autoload and perhaps even feature but the details of how, exactly, they work may be a little murky. This video clears that up and shows you how to leverage them to speed up your Emacs load and running time.

This entry was posted in General and tagged . Bookmark the permalink.