emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Slow movement in large buffers


From: Lawrence Mitchell
Subject: Re: [O] Slow movement in large buffers
Date: Tue, 15 Mar 2011 12:33:36 +0000
User-agent: Gnus/5.110014 (No Gnus v0.14) Emacs/24.0.50 (gnu/linux)

Carsten Dominik wrote:
> 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?

For me, all the time is spent in vertical-motion (which is C
level, so I can't get a more detailed breakdown).

>> In my experience, the maximum workable size of org files is around
>> 10,000 lines. Beyond that, Emacs starts to spin its wheels.

> Not good at all.

I believe it is likely to be due to org's large use of overlays.
Here's a quote from the elisp manual:

| (elisp)Overlays
|    The visual effect of an overlay is the same as of the corresponding
| text property ....  However, due to a different
| implementation, *overlays generally don't scale well* (many operations
| take a time that is proportional to the number of overlays in the
| buffer).  If you need to affect the visual appearance of many portions
| in the buffer, we recommend using text properties.

Emphasis added.

For example, in org-issues.org:

M-: (loop for l in (overlay-lists) sum (length l)) RET => 3823

And vertical motion (with C-n, C-p) takes a long time.

remove all the overlays

M-: (remove-overlays) RET

collapse the buffer again

M-x org-shifttab RET

Now vertical motion is rapid.

This suggests that one should try and see if overlays in org
buffers can be replaced by text properties.  Which do not cause
the same slowdown.

Lawrence
-- 
Lawrence Mitchell <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]