Carsten Dominik <carsten.domi...@gmail.com> writes: > On Mar 15, 2011, at 4:25 AM, Matt Lundin wrote: > >> I've been navigating the org-issues file (14000+ lines) and have found >> movement within the file to be fairly slow. Sometimes Emacs will lock up >> for several seconds. >> >> For instance, to move from the level one heading "* Other" to "* Closed >> issues" when the outline is folded takes over three seconds: >> >> --8<---------------cut here---------------start------------->8--- >> next-line 1 3.015289 3.015289 >> --8<---------------cut here---------------end--------------->8--- >> > > Wow, this is really bad. > Could you use elp and instrument org, outline, > and font-lock, and do that motion and report > the results? >
I instrumented those packages (along with next-line and previous-line) and turned off flyspell. Unfortunately, it seems there is something else involved, as previous-line is the only function registered by elp-results: --8<---------------cut here---------------start------------->8--- previous-line 1 2.524475 2.524475 --8<---------------cut here---------------end--------------->8--- This time, moving forward was faster than moving backward. The slowness occurred when moving back from "* Other" to "* Development Tasks" in the folded org-issues.org buffer. The movement jumped over a region containing 4000 lines. Since nothing from org or outline showed up in the results, I instrumented the various functions called by previous-line. The culprit seems to be a function written in C: vertical-motion. So this seems to be an Emacs issue, rather than an org or outline issue. --8<---------------cut here---------------start------------->8--- previous-line 1 2.5365349999 2.5365349999 line-move 1 2.536489 2.536489 line-move-visual 1 2.536436 2.536436 vertical-motion 1 2.508419 2.508419 font-lock-mode 1 3.7e-05 3.7e-05 line-move-partial 1 1.4e-05 1.4e-05 font-lock-default-function 1 9e-06 9e-06 window-hscroll 1 4e-06 4e-06 --8<---------------cut here---------------end--------------->8--- Best, Matt