hvesalai / emacs-scala-mode

The definitive scala-mode for emacs
http://ensime.org
GNU General Public License v3.0
361 stars 68 forks source link

performance of font-lock-fontify-keywords-region #97

Closed fommil closed 9 years ago

fommil commented 9 years ago

I'm not sure if this is scala-mode doing this, but Emacs started running really slowly for me in a big file and I took a profile-report:

- redisplay_internal (C function)                                3129  74%
 - jit-lock-function                                             3121  74%
  - jit-lock-fontify-now                                         3121  74%
   - funcall                                                     3121  74%
    - #<compiled 0xb3e4c9>                                       3121  74%
     - run-hook-with-args                                        3121  74%
      - font-lock-fontify-region                                 3121  74%
       - font-lock-default-fontify-region                        3121  74%
        - font-lock-fontify-keywords-region                      3093  74%
         + eval                                                   112   2%
         + scala-font-lock:mark-pattern1-part                      39   0%
           scala-font-lock:mark-reserved-symbols                   36   0%
         + scala-font-lock:mark-integerLiteral                      8   0%
           scala-font-lock:mark-underscore                          8   0%
        + font-lock-fontify-syntactically-region                   28   0%

it all seems to be internal work in the font-lock-fontify-keywords-region can you think of anything that might be causing a problem in scala-mode? I assume it is scala-mode that is defining the keywords for the mode.

Sadly I can't share the file with you, but if I can ever reproduce in a public project, most definitely. Probably for the best, this file would burn your retinas.

fommil commented 9 years ago

This issue was moved to ensime/ensime-emacs#227