How can I debug emacs' slow startup time?

Mike picture Mike · Sep 6, 2012 · Viewed 7.6k times · Source

I recently got a new Retina MacBook Pro, with Mountain Lion. Unfortunately, emacs is taking forever to startup (around 5s) on my new computer. I tried installing the latest homebrew version of emacs, but the problem persists. I don't have a .emacs file, so I'm clueless as to what could be causing the slow startup.

What tools do I have at my disposal to debug where emacs is spending its time during startup?

Answer

jmdeldin picture jmdeldin · Sep 8, 2012

It looks like you need to have a fully-qualified domain name for your computer's hostname (e.g., myretina.local); otherwise, Emacs will be slow to start.

You can verify your hostname via Terminal with

hostname

and you can set it with

sudo scutil --set HostName myretina.local