From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: Slow movement in large buffers Date: Tue, 15 Mar 2011 08:50:50 -0400 Message-ID: <87oc5cy2c5.fsf@fastmail.fm> References: <87d3ltjc8x.fsf@fastmail.fm> <17242340-A14F-495A-B144-20C96D52B620@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=58293 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzTiA-0003ab-Br for emacs-orgmode@gnu.org; Tue, 15 Mar 2011 08:50:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzTi9-00010u-1L for emacs-orgmode@gnu.org; Tue, 15 Mar 2011 08:50:54 -0400 Received: from out5.smtp.messagingengine.com ([66.111.4.29]:58110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzTi8-00010i-RX for emacs-orgmode@gnu.org; Tue, 15 Mar 2011 08:50:52 -0400 In-Reply-To: <17242340-A14F-495A-B144-20C96D52B620@gmail.com> (Carsten Dominik's message of "Tue, 15 Mar 2011 12:18:51 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: Org Mode Carsten Dominik 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