Byte Compiling Elisp

I used to obsess about byte compiling my Elisp files but then I realized that

  1. The only thing I ever byte compiled was my init.el and updates to the packages I load.
  2. Byte compiling your startup file makes no appreciable difference.
  3. Once I started using ELPA, it took care of compiling my packages.

As I result, I don't worry about it much anymore. Still, many Emacs users are working on packages and do need to keep things compiled.

For those in that position, there are a couple of useful recent posts worth your time. First, Bozhidar Batsov over at the invaluable Emacs Redux has a nice post about byte compiling with some Elisp that automatically deletes old .elc files when you save a new .el file of the same name.

Second, Xah Lee has a another nice post on the subject that includes some Elisp that will automatically recompile an existing .elc file when the corresponding .el file is saved. This is probably the behavior you want so you should take a look at his code if you regularly compile your Elisp.

This entry was posted in Programming and tagged . Bookmark the permalink.
  • mike mazurek

    I take issue with the claim that byte compiling your init file makes no appreciable difference. With a compiled init file my emacs startup time is about 1.5 seconds. Startup with a non compiled init file takes around 4 seconds. The difference is noticeable to me.