At the weekend I wiped my dotfiles and replaced them with prelude. I do most of my work in C#, so I've got csharp-mode installed.

Typing in c# is laggy, in a painful bursty way. A few words come out smoothly, then there's a big pause over the next few words. There's no problem with moving the cursor around or scrolling the buffer.

I've tried turning off minor modes on a buffer and continuing to type. I've disabled the following with no change to the problem:
- projectile-mode
- company-mode
- guru-mode (think this is a prelude thing?)
- flycheck-mode

My mode line says I've got C#/l, MRev, Helm, SP, Pre and Abbrev still running. They all seem pretty important.

There's nothing in the messages buffer when these pauses occur.

I'm using emacs 24.4.

Is there any keystroke profiling I can turn on, to see what's slowing things down?

  • 1
    Use describe-mode to see a list of enabled minor modes, continue to disable them one by one. Apr 13, 2015 at 13:39
  • 2
    As for profiling, there's a built-in command profiler-start. Try starting the profiler, editing until you get the lag, and then stop the profiler and inspect the output.
    – nanny
    Apr 13, 2015 at 13:44

1 Answer 1


With help from nanny and jordan biondo, I profiled, entered some newlines in a class, and found the following:


I don't tend to use imenu anyway, so I customised csharp-want-imenu to nil, rebooted, and now things are much much better.

Good work everyone!

  • You're lucky, in my case it's lagging …lock-fontify… functions, and seems here's nothing I can do. By the way, «imenu» is actually cool thing — try to use it with idomenu function, it's great.
    – Hi-Angel
    May 6, 2015 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.