title: mercurial slows emacs to death when opening/saving files
body: <p>As the title says, when I open or save a file in emacs which is in an hg repo, it takes up to <s>7</s> 3 (see update at the bottom) seconds to open the file. I'm on OS X on a macbook retina with solid state and plenty of power. Opening a non version controlled file seems instant.</p>
  
  <p>Looking at <a href="https://stackoverflow.com/questions/6724471/git-slows-down-emacs-to-death-how-to-fix-this">this question</a> which is the same for git, I determined that <code>vc-call-backend</code> is taking up most of the time. Here's an elp profile of a single find-file:</p>
  
  <pre>
  function                                    call count        total time    avg time
  find-file                                         1           3.043015      3.043015
  vc-call-backend                                   12          2.222802      0.1852335000
  vc-find-file-hook                                 1           1.117738      1.117738
  vc-hg-state                                       2           0.8375429999  0.4187714999
  vc-mode-line                                      1           0.691795      0.691795
  vc-default-mode-line-string                       1           0.691761      0.691761
  vc-backend                                        1           0.42589       0.42589
  vc-registered                                     1           0.425868      0.425868
  vc-hg-registered                                  1           0.424229      0.424229
  vc-state                                          1           0.413661      0.413661
  vc-state-refresh                                  1           0.413652      0.413652
  vc-default-state-heuristic                        1           0.413626      0.413626
  vc-working-revision                               1           0.278064      0.278064
  vc-hg-working-revision                            1           0.27795       0.27795
  
  ... (I cut everything below this line, all ran very quickly)
  </pre>
  
  <p>In this repository, running <code>hg status</code> from the command line takes almost 4 seconds (it's large), so my theory is that emacs is querying status so it can display something.</p>
  
  <p>So my real question is how to make this less painful, without completely disabling <code>vc-mode</code>. I use <code>ediff-revision</code> <code>vc-annotate</code> and <code>vc-log-dir</code> constantly and wouldn't want to disable those features, but I don't think any of those should require a <code>find-file</code> hook. I don't care if I don't see the status bar line indicating status. Googling has given me few good suggestions. I don't want to manually enable and disable <code>vc-mode</code> all the time, I want something as automatic as possible.</p>
  
  <p>Thanks!</p>
  
  <p>UPDATE: it turns out that most of the problem was with a mercurial extension I was using that was part of kiln (kbfiles, <a href="http://kiln.stackexchange.com/questions/3319/answer" rel="nofollow noreferrer">see this</a>). Things are still slow, but less painful. I updated the elp profile above with the new numbers</p>