emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Slow movement in large buffers
@ 2011-03-15  3:25 Matt Lundin
  2011-03-15  5:03 ` Carsten Dominik
                   ` (3 more replies)
  0 siblings, 4 replies; 26+ messages in thread
From: Matt Lundin @ 2011-03-15  3:25 UTC (permalink / raw)
  To: Org Mode

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---

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

Do others have the same experience? If so, does anyone have any tips on
how to diagnose this further?

(insert "\n" emacs-version)
23.3.1

(insert "\n" org-version)
7.5

Best,
Matt

 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15  3:25 Slow movement in large buffers Matt Lundin
@ 2011-03-15  5:03 ` Carsten Dominik
  2011-03-15 12:51   ` Matt Lundin
  2011-03-15 10:58 ` Eric S Fraga
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 26+ messages in thread
From: Carsten Dominik @ 2011-03-15  5:03 UTC (permalink / raw)
  To: Matt Lundin; +Cc: Org Mode

DO you have flyspell turned on?

- Carsten

On 15.3.2011, at 04:25, 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---
> 
> In my experience, the maximum workable size of org files is around
> 10,000 lines. Beyond that, Emacs starts to spin its wheels.
> 
> Do others have the same experience? If so, does anyone have any tips on
> how to diagnose this further?
> 
> (insert "\n" emacs-version)
> 23.3.1
> 
> (insert "\n" org-version)
> 7.5
> 
> Best,
> Matt
> 
> 
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15  3:25 Slow movement in large buffers Matt Lundin
  2011-03-15  5:03 ` Carsten Dominik
@ 2011-03-15 10:58 ` Eric S Fraga
  2011-03-15 12:54   ` Matt Lundin
  2011-03-15 11:18 ` Carsten Dominik
  2011-03-15 16:11 ` Chris Randle
  3 siblings, 1 reply; 26+ messages in thread
From: Eric S Fraga @ 2011-03-15 10:58 UTC (permalink / raw)
  To: Matt Lundin; +Cc: Org Mode

Matt Lundin <mdl@imapmail.org> writes:

> 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:
>
> next-line     1           3.015289      3.015289
>
> In my experience, the maximum workable size of org files is around
> 10,000 lines. Beyond that, Emacs starts to spin its wheels.
>
> Do others have the same experience? If so, does anyone have any tips on
> how to diagnose this further?
>
> (insert "\n" emacs-version)
> 23.3.1
>
> (insert "\n" org-version)
> 7.5
>
> Best,
> Matt
>
>  

Interesting.  It doesn't take 3 seconds on my system (Intel(R)
Pentium(R) D CPU 2.80GHz) but there is a noticeable delay using C-n to
move from =* Other= to =* Closed issues=.  However, using C-cC-n to move
has no delay at all and moving backwards (either C-p or C-cC-p) also
exhibits no delay.

I have noticed significant slowness in some of my own files lately when
including babel source code blocks, especially latex ones.  But I
haven't been able to reproduce this slowness predictably enough to
instrument it and hence report it in any useful sense... still
experimenting.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.38.gf8c6.dirty)

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15  3:25 Slow movement in large buffers Matt Lundin
  2011-03-15  5:03 ` Carsten Dominik
  2011-03-15 10:58 ` Eric S Fraga
@ 2011-03-15 11:18 ` Carsten Dominik
  2011-03-15 12:33   ` Lawrence Mitchell
                     ` (2 more replies)
  2011-03-15 16:11 ` Chris Randle
  3 siblings, 3 replies; 26+ messages in thread
From: Carsten Dominik @ 2011-03-15 11:18 UTC (permalink / raw)
  To: Matt Lundin; +Cc: Org Mode


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?

> 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.

- Carsten

> 
> Do others have the same experience? If so, does anyone have any tips on
> how to diagnose this further?
> 
> (insert "\n" emacs-version)
> 23.3.1
> 
> (insert "\n" org-version)
> 7.5
> 
> Best,
> Matt
> 
> 
> 

- Carsten

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15 11:18 ` Carsten Dominik
@ 2011-03-15 12:33   ` Lawrence Mitchell
  2011-03-15 12:50   ` Matt Lundin
  2011-03-15 14:15   ` Nick Dokos
  2 siblings, 0 replies; 26+ messages in thread
From: Lawrence Mitchell @ 2011-03-15 12:33 UTC (permalink / raw)
  To: emacs-orgmode

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 <wence@gmx.li>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15 11:18 ` Carsten Dominik
  2011-03-15 12:33   ` Lawrence Mitchell
@ 2011-03-15 12:50   ` Matt Lundin
  2011-03-15 14:15   ` Nick Dokos
  2 siblings, 0 replies; 26+ messages in thread
From: Matt Lundin @ 2011-03-15 12:50 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Org Mode

Carsten Dominik <carsten.dominik@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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15  5:03 ` Carsten Dominik
@ 2011-03-15 12:51   ` Matt Lundin
  0 siblings, 0 replies; 26+ messages in thread
From: Matt Lundin @ 2011-03-15 12:51 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Org Mode

Carsten Dominik <carsten.dominik@gmail.com> writes:

> DO you have flyspell turned on?
>
Yes, but the same results occur with flyspell turned off. (See my
response to your other email.)

Best,
Matt 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15 10:58 ` Eric S Fraga
@ 2011-03-15 12:54   ` Matt Lundin
  2011-03-15 14:09     ` Eric S Fraga
  0 siblings, 1 reply; 26+ messages in thread
From: Matt Lundin @ 2011-03-15 12:54 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: Org Mode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> Matt Lundin <mdl@imapmail.org> writes:

> Interesting.  It doesn't take 3 seconds on my system (Intel(R)
> Pentium(R) D CPU 2.80GHz) but there is a noticeable delay using C-n to
> move from =* Other= to =* Closed issues=.  However, using C-cC-n to move
> has no delay at all and moving backwards (either C-p or C-cC-p) also
> exhibits no delay.

You are right. The slowness only occurs when using next-line and
previous-line. When I use the functions for navigating outlines (e.g.,
outline-next-visible-heading), the movement is instantaneous.

Best,
Matt

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15 12:54   ` Matt Lundin
@ 2011-03-15 14:09     ` Eric S Fraga
  2011-03-15 17:42       ` Carsten Dominik
  0 siblings, 1 reply; 26+ messages in thread
From: Eric S Fraga @ 2011-03-15 14:09 UTC (permalink / raw)
  To: Matt Lundin; +Cc: Org Mode

Hello,

following up on this issue, I have just run into it again.  I'm editing
a not very large document and suddenly things slowed down, mostly but
not exclusively for "next-line":

--8<---------------cut here---------------start------------->8---
next-line                                                     18          2.1547069999  0.1197059444
previous-line                                                 19          0.4066669999  0.0214035263
org-mode-flyspell-verify                                      16          5.299...e-05  3.312...e-06
--8<---------------cut here---------------end--------------->8---

This happened when I started a new source code block (gnuplot, to be
exact) but didn't type in the end_src line for a while.  The problem
seems to be due to font-locking and it tries to font-lock the whole
document initially.  When I eventually get around to typing the end_src
line, it font-locks correctly but things are slow thereafter.  There
seems to be some hysteresis loop in the code...

If I kill the buffer and reload the file, everything is fine.

--8<---------------cut here---------------start------------->8---
next-line                                                     17          0.0655900000  0.0038582352
previous-line                                                 17          0.0115249999  0.0006779411
org-mode                                                      1           0.007178      0.007178
org-fontify-meta-lines-and-blocks                             25          0.0022920000  9.168...e-05
org-set-startup-visibility                                    1           0.001619      0.001619
org-raise-scripts                                             25          0.0013889999  5.555...e-05
--8<---------------cut here---------------end--------------->8---

Dramatic difference!

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.38.gf8c6.dirty)

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15 11:18 ` Carsten Dominik
  2011-03-15 12:33   ` Lawrence Mitchell
  2011-03-15 12:50   ` Matt Lundin
@ 2011-03-15 14:15   ` Nick Dokos
  2011-03-15 15:51     ` Matt Lundin
  2 siblings, 1 reply; 26+ messages in thread
From: Nick Dokos @ 2011-03-15 14:15 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Matt Lundin, Org Mode, nicholas.dokos

Carsten Dominik <carsten.dominik@gmail.com> 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?
> 
> > 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.
> 
> - Carsten
> 
> > 
> > Do others have the same experience? If so, does anyone have any tips on
> > how to diagnose this further?
> > 
> > (insert "\n" emacs-version)
> > 23.3.1
> > 
> > (insert "\n" org-version)
> > 7.5
> > 

FWIW, I opened org-issues.org and followed Matt's lead: at first, I got
almost instant response going from Other to Closed (using arrow-down)
and a slight hesitation (< 0.5s) going from Other to the previous
headline (Development Tasks).  After noodling around for a while
(including the motions that Eric F. suggested and getting no delays
there), I tried it again and could discern no delay going either
way. And I do run flyspell in org buffers.

This is on a fairly recent vintage laptop with an i7 quad core processor
(2.67GHz) and 4G of memory. That probably explains some of the difference
I see. Matt, what kind of hardware are you using?

Nick

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15 14:15   ` Nick Dokos
@ 2011-03-15 15:51     ` Matt Lundin
  2011-03-15 17:39       ` Carsten Dominik
  2011-03-15 22:00       ` Christian Moe
  0 siblings, 2 replies; 26+ messages in thread
From: Matt Lundin @ 2011-03-15 15:51 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Org Mode, Carsten Dominik

Nick Dokos <nicholas.dokos@hp.com> writes:

> FWIW, I opened org-issues.org and followed Matt's lead: at first, I got
> almost instant response going from Other to Closed (using arrow-down)
> and a slight hesitation (< 0.5s) going from Other to the previous
> headline (Development Tasks).  After noodling around for a while
> (including the motions that Eric F. suggested and getting no delays
> there), I tried it again and could discern no delay going either
> way. And I do run flyspell in org buffers.
>
> This is on a fairly recent vintage laptop with an i7 quad core processor
> (2.67GHz) and 4G of memory. That probably explains some of the difference
> I see. Matt, what kind of hardware are you using?

Yes, hardware is indeed a factor here. I'm using a dual-core Atom processor
with 2GB of memory.

Matt

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15  3:25 Slow movement in large buffers Matt Lundin
                   ` (2 preceding siblings ...)
  2011-03-15 11:18 ` Carsten Dominik
@ 2011-03-15 16:11 ` Chris Randle
  2011-03-15 16:41   ` MidLifeXis at PerlMonks
  2011-03-15 17:14   ` Scott Randby
  3 siblings, 2 replies; 26+ messages in thread
From: Chris Randle @ 2011-03-15 16:11 UTC (permalink / raw)
  To: emacs-orgmode

Hi Matt

On 2011-03-15 03:25, 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.
<snip>
> Do others have the same experience? If so, does anyone have any tips
> on how to diagnose this further?

I keep all my info in one big Org-mode file which is currently just shy
of 115,000 lines. There's the occasional "stutter" of a fraction of a
second when I move across closed nodes containing large chunks, but it's
still perfectly acceptable (to me, anyway!).

My PC is an Intel dual-core 2.66GHz with 4GB RAM, so nothing
earth-shattering.

-- 
Chris Randle

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15 16:11 ` Chris Randle
@ 2011-03-15 16:41   ` MidLifeXis at PerlMonks
  2011-03-15 17:14   ` Scott Randby
  1 sibling, 0 replies; 26+ messages in thread
From: MidLifeXis at PerlMonks @ 2011-03-15 16:41 UTC (permalink / raw)
  To: emacs-orgmode

I have seen this happen when I have largish files with tables.  I also have a 
file
setting of:

#+begin_src org
  #+STARTUP: align
#+end_src


which turns on automatic alignment of things recognized as table-like.  If I 
remove
this startup directive, things tend to run more smoothly.

I have not formally reproduced this problem, and am currently going by memory as
to when I have seen it, so YMMV (and so might mine).

MidLifeXis


----- Original Message ----
From: Chris Randle <chris@amlog.co.uk>
To: emacs-orgmode@gnu.org
Sent: Tue, March 15, 2011 11:11:23 AM
Subject: Re: [O] Slow movement in large buffers

Hi Matt

On 2011-03-15 03:25, 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.
<snip>
> Do others have the same experience? If so, does anyone have any tips
> on how to diagnose this further?

I keep all my info in one big Org-mode file which is currently just shy
of 115,000 lines. There's the occasional "stutter" of a fraction of a
second when I move across closed nodes containing large chunks, but it's
still perfectly acceptable (to me, anyway!).

My PC is an Intel dual-core 2.66GHz with 4GB RAM, so nothing
earth-shattering.

-- Chris Randle

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15 16:11 ` Chris Randle
  2011-03-15 16:41   ` MidLifeXis at PerlMonks
@ 2011-03-15 17:14   ` Scott Randby
  2011-03-15 17:18     ` Erik Iverson
  2011-03-15 17:38     ` Carsten Dominik
  1 sibling, 2 replies; 26+ messages in thread
From: Scott Randby @ 2011-03-15 17:14 UTC (permalink / raw)
  To: emacs-orgmode

On 03/15/2011 12:11 PM, Chris Randle wrote:
> Hi Matt
> 
> On 2011-03-15 03:25, 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.
> <snip>
>> Do others have the same experience? If so, does anyone have any tips
>> on how to diagnose this further?
> 
> I keep all my info in one big Org-mode file which is currently just shy
> of 115,000 lines. There's the occasional "stutter" of a fraction of a
> second when I move across closed nodes containing large chunks, but it's
> still perfectly acceptable (to me, anyway!).
> 
> My PC is an Intel dual-core 2.66GHz with 4GB RAM, so nothing
> earth-shattering.
> 

I have a netbook running an Intel dual-core 1.66GHz and 2GB RAM. I
opened up org-issues.org and navigated through it without difficulty.
There was a delay for about a second when I unfolded the "Development
Tasks" headline, but there were no delays after that. Vertical movement
is instantaneous.

Scott Randby

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15 17:14   ` Scott Randby
@ 2011-03-15 17:18     ` Erik Iverson
  2011-03-15 17:38     ` Carsten Dominik
  1 sibling, 0 replies; 26+ messages in thread
From: Erik Iverson @ 2011-03-15 17:18 UTC (permalink / raw)
  To: Scott Randby; +Cc: emacs-orgmode

Scott Randby wrote:
> On 03/15/2011 12:11 PM, Chris Randle wrote:
>> On 2011-03-15 03:25, 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.
>> <snip>
>>> Do others have the same experience? If so, does anyone have any tips
>>> on how to diagnose this further?

<snip>

> I have a netbook running an Intel dual-core 1.66GHz and 2GB RAM. I
> opened up org-issues.org and navigated through it without difficulty.
> There was a delay for about a second when I unfolded the "Development
> Tasks" headline, but there were no delays after that. Vertical movement
> is instantaneous.

Do those who experience slowness have a line-numbering mode in Emacs
turned on?  (linum-mode perhaps?)

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15 17:14   ` Scott Randby
  2011-03-15 17:18     ` Erik Iverson
@ 2011-03-15 17:38     ` Carsten Dominik
  2011-05-11  0:41       ` Carmine Casciato
  1 sibling, 1 reply; 26+ messages in thread
From: Carsten Dominik @ 2011-03-15 17:38 UTC (permalink / raw)
  To: Scott Randby; +Cc: emacs-orgmode


On 15.3.2011, at 18:14, Scott Randby wrote:

> On 03/15/2011 12:11 PM, Chris Randle wrote:
>> Hi Matt
>> 
>> On 2011-03-15 03:25, 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.
>> <snip>
>>> Do others have the same experience? If so, does anyone have any tips
>>> on how to diagnose this further?
>> 
>> I keep all my info in one big Org-mode file which is currently just shy
>> of 115,000 lines. There's the occasional "stutter" of a fraction of a
>> second when I move across closed nodes containing large chunks, but it's
>> still perfectly acceptable (to me, anyway!).
>> 
>> My PC is an Intel dual-core 2.66GHz with 4GB RAM, so nothing
>> earth-shattering.
>> 
> 
> I have a netbook running an Intel dual-core 1.66GHz and 2GB RAM. I
> opened up org-issues.org and navigated through it without difficulty.
> There was a delay for about a second when I unfolded the "Development
> Tasks" headline, but there were no delays after that. Vertical movement
> is instantaneous.


One reason why the motion in a folded buffer is slow:
calling next line on the heading of a folded tree must
move down potentially thousands of buffer lines.  In each buffer
line it checks if the text is still invisible and then moves one.
So this kind of buffer motion is not optimized for outline
buffers.  Still, what Matt and others report is unacceptable,
and there must be a solution.  I have very slight delays
in org-issues.org, but nothing like 5 seconds.   Fractions
of a second, at most.

- Carsten

> 
> Scott Randby
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15 15:51     ` Matt Lundin
@ 2011-03-15 17:39       ` Carsten Dominik
  2011-03-15 22:00       ` Christian Moe
  1 sibling, 0 replies; 26+ messages in thread
From: Carsten Dominik @ 2011-03-15 17:39 UTC (permalink / raw)
  To: Matt Lundin; +Cc: nicholas.dokos, Org Mode


On 15.3.2011, at 16:51, Matt Lundin wrote:

> Nick Dokos <nicholas.dokos@hp.com> writes:
> 
>> FWIW, I opened org-issues.org and followed Matt's lead: at first, I got
>> almost instant response going from Other to Closed (using arrow-down)
>> and a slight hesitation (< 0.5s) going from Other to the previous
>> headline (Development Tasks).  After noodling around for a while
>> (including the motions that Eric F. suggested and getting no delays
>> there), I tried it again and could discern no delay going either
>> way. And I do run flyspell in org buffers.
>> 
>> This is on a fairly recent vintage laptop with an i7 quad core processor
>> (2.67GHz) and 4G of memory. That probably explains some of the difference
>> I see. Matt, what kind of hardware are you using?
> 
> Yes, hardware is indeed a factor here. I'm using a dual-core Atom processor
> with 2GB of memory.

Well, it should not be a hardware issue to move the cursor down a line.

- Carsten

> 
> Matt

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Re: Slow movement in large buffers
  2011-03-15 14:09     ` Eric S Fraga
@ 2011-03-15 17:42       ` Carsten Dominik
  0 siblings, 0 replies; 26+ messages in thread
From: Carsten Dominik @ 2011-03-15 17:42 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: Matt Lundin, Org Mode


On 15.3.2011, at 15:09, Eric S Fraga wrote:

> Hello,
> 
> following up on this issue, I have just run into it again.  I'm editing
> a not very large document and suddenly things slowed down, mostly but
> not exclusively for "next-line":
> 
> --8<---------------cut here---------------start------------->8---
> next-line                                                     18          2.1547069999  0.1197059444
> previous-line                                                 19          0.4066669999  0.0214035263
> org-mode-flyspell-verify                                      16          5.299...e-05  3.312...e-06
> --8<---------------cut here---------------end--------------->8---
> 
> This happened when I started a new source code block (gnuplot, to be
> exact) but didn't type in the end_src line for a while.  The problem
> seems to be due to font-locking and it tries to font-lock the whole
> document initially.  When I eventually get around to typing the end_src
> line, it font-locks correctly but things are slow thereafter.  There
> seems to be some hysteresis loop in the code...

This sounds like a bug that needs to be fixed in the block fontifications,
maybe a limit for how far to search for the end line.  regular expressions
that match many lines need to be carefully constructed - there are possible
backtracking traps that can make the matching time scale as the number of
characters squared.

- Carsten

> 
> If I kill the buffer and reload the file, everything is fine.
> 
> --8<---------------cut here---------------start------------->8---
> next-line                                                     17          0.0655900000  0.0038582352
> previous-line                                                 17          0.0115249999  0.0006779411
> org-mode                                                      1           0.007178      0.007178
> org-fontify-meta-lines-and-blocks                             25          0.0022920000  9.168...e-05
> org-set-startup-visibility                                    1           0.001619      0.001619
> org-raise-scripts                                             25          0.0013889999  5.555...e-05
> --8<---------------cut here---------------end--------------->8---
> 
> Dramatic difference!
> 
> -- 
> : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
> : using Org-mode version 7.5 (release_7.5.38.gf8c6.dirty)
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Re: Slow movement in large buffers
  2011-03-15 15:51     ` Matt Lundin
  2011-03-15 17:39       ` Carsten Dominik
@ 2011-03-15 22:00       ` Christian Moe
  2011-03-15 22:56         ` Nick Dokos
  1 sibling, 1 reply; 26+ messages in thread
From: Christian Moe @ 2011-03-15 22:00 UTC (permalink / raw)
  To: Matt Lundin; +Cc: nicholas.dokos, Org Mode, Carsten Dominik


> Yes, hardware is indeed a factor here. I'm using a dual-core Atom processor
> with 2GB of memory.
>
> Matt
>

I'm not so sure about the hardware factor.

I'm on a seven-year-old G4 Mac PPC laptop with 768 MB RAM.

Over the same folded headings in a freshly pulled org-issues (Other to 
Development Tasks), I get

previous-line      5       5.89456       1.178912

Definitely a lag, but not as bad as you're seeing.


Yours,
Christian

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Re: Slow movement in large buffers
  2011-03-15 22:00       ` Christian Moe
@ 2011-03-15 22:56         ` Nick Dokos
  2011-03-15 23:13           ` Christian Moe
  2011-03-16  1:16           ` Bastien
  0 siblings, 2 replies; 26+ messages in thread
From: Nick Dokos @ 2011-03-15 22:56 UTC (permalink / raw)
  To: mail; +Cc: Matt Lundin, Org Mode, nicholas.dokos, Carsten Dominik

Christian Moe <mail@christianmoe.com> wrote:

> 
> > Yes, hardware is indeed a factor here. I'm using a dual-core Atom processor
> > with 2GB of memory.
> >
> > Matt
> >
> 
> I'm not so sure about the hardware factor.
> 
> I'm on a seven-year-old G4 Mac PPC laptop with 768 MB RAM.
> 
> Over the same folded headings in a freshly pulled org-issues (Other to
> Development Tasks), I get
> 
> previous-line      5       5.89456       1.178912
> 
> Definitely a lag, but not as bad as you're seeing.
> 
> 

True, but it's still a factor: on my laptop I get

--8<---------------cut here---------------start------------->8---
previous-line  2           1.435139      0.7175695
next-line      1           0.446293      0.446293
--8<---------------cut here---------------end--------------->8---

being very careful to avoid next-line/previous-line in any other
context:  that was one next-line from "Other" to "Closed issues" and two
previous-lines from "Closed Issues" to "Other" to "Development
Tasks". Given the five previous-lines in your profile, I suspect that
one or two were much longer than the others which skewed the average.

Given the evidence that Lawrence Mitchell provided however, it seems clear
that most of the blame can be placed on overlays - no?

Nick

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Re: Slow movement in large buffers
  2011-03-15 22:56         ` Nick Dokos
@ 2011-03-15 23:13           ` Christian Moe
  2011-03-16  3:48             ` Nick Dokos
  2011-03-16  1:16           ` Bastien
  1 sibling, 1 reply; 26+ messages in thread
From: Christian Moe @ 2011-03-15 23:13 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Matt Lundin, Org Mode, Carsten Dominik

On 3/15/11 11:56 PM, Nick Dokos wrote:
  Given the five previous-lines in your profile, I suspect that
> one or two were much longer than the others which skewed the average.

Actually not, I was going back and forth over the same two lines, and 
previous-line was fairly stable at around 1.2 seconds each time. 
Anyway, that's moot since, as you say,

> Given the evidence that Lawrence Mitchell provided however, it seems clear
> that most of the blame can be placed on overlays

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Re: Slow movement in large buffers
  2011-03-15 22:56         ` Nick Dokos
  2011-03-15 23:13           ` Christian Moe
@ 2011-03-16  1:16           ` Bastien
  2011-03-18  0:37             ` Matt Lundin
  1 sibling, 1 reply; 26+ messages in thread
From: Bastien @ 2011-03-16  1:16 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Matt Lundin, Org Mode, mail, Carsten Dominik

Nick Dokos <nicholas.dokos@hp.com> writes:

> Given the evidence that Lawrence Mitchell provided however, it seems clear
> that most of the blame can be placed on overlays - no?

Yes, probably.

I've also experience slow motion in some big files of mine.

One factor was the use of the :ARCHIVE: tag.  I tried to remove this
tag, and things were fast again.  Another factor might be the use of
folded drawers and #+begin_src environments.

So I guess the problem boils down to 2 factors: the number of *nested
overlays*, and the number of lines in each.  How these factors interact
is hard to guess.

Instead of testing from org-issues.org (which is pretty messy), maybe 
we can have a testing/overlays.org file with a systematic structure?

#+begin_src org
* headline 1

** A subheading with 100 lines

lines ... lines (x 100)

* headline 2

** A subheading with 100 lines (x 100)
   :PROPERTIES:
   :LOCATION: Erewhon
   :END:

lines ... lines (x 100)

* headline 3

** A subheading with begin_src env and 100 lines (x 100)

  #+begin_src emacs-lisp
  (defun fixme ()
    "Some random defun"
    (message "This is not a message")
  #+begin_src

lines ... lines (x 100)

* headline 4

** subheading with archive tag and 100 lines :ARCHIVE: (x 100)

lines ... lines (x 100)
#+end_src

Matt, can you build and locally test such a file?  Then instrument
next-line when jumping from headline 1 to 2, to 3, to 4?

-- 
 Bastien

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Re: Slow movement in large buffers
  2011-03-15 23:13           ` Christian Moe
@ 2011-03-16  3:48             ` Nick Dokos
  0 siblings, 0 replies; 26+ messages in thread
From: Nick Dokos @ 2011-03-16  3:48 UTC (permalink / raw)
  To: mail; +Cc: nicholas.dokos, Org Mode

Christian Moe <mail@christianmoe.com> wrote:

> On 3/15/11 11:56 PM, Nick Dokos wrote:
>   Given the five previous-lines in your profile, I suspect that
> > one or two were much longer than the others which skewed the average.
> 
> Actually not, I was going back and forth over the same two lines, and 
> previous-line was fairly stable at around 1.2 seconds each time. 

My apologies. It took me a couple of tries to get things right and
I made an unwarranted generalization.

Thanks,
Nick

> Anyway, that's moot since, as you say,
> 
> > Given the evidence that Lawrence Mitchell provided however, it seems clear
> > that most of the blame can be placed on overlays
> 
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-16  1:16           ` Bastien
@ 2011-03-18  0:37             ` Matt Lundin
  0 siblings, 0 replies; 26+ messages in thread
From: Matt Lundin @ 2011-03-18  0:37 UTC (permalink / raw)
  To: Bastien; +Cc: nicholas.dokos, Org Mode, mail, Carsten Dominik

Bastien <bzg@altern.org> writes:

> Matt, can you build and locally test such a file?  Then instrument
> next-line when jumping from headline 1 to 2, to 3, to 4?

I'm on the job. :)

I'll write back with an official report. Suffice it to say that my early
experiments show org-mode cruising through the examples you gave me, but
slowing considerably whenever, as you suspected, there are numerous
nested overlays.

I tried, unwisely, to create a tree consisting of 100 subtrees, each of
which contained a quote, a drawer, and 100 additional subtrees, each of
which, in turn contained a drawer. It not only took the better part of a
minute to cycle the tree, but it sent my emacs memory usage
skyrocketing. Needless to say, 10000 nested entries, each with quotes
and drawers, is an extreme case. :)

Best,
Matt

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-03-15 17:38     ` Carsten Dominik
@ 2011-05-11  0:41       ` Carmine Casciato
  2011-05-12  6:59         ` Eric S Fraga
  0 siblings, 1 reply; 26+ messages in thread
From: Carmine Casciato @ 2011-05-11  0:41 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik <carsten.dominik <at> gmail.com> writes:
 
> >> On 2011-03-15 03:25, 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.
> >> <snip>
> >>> Do others have the same experience? If so, does anyone have any tips
> >>> on how to diagnose this further?
> >> 
> >> I keep all my info in one big Org-mode file which is currently just shy
> >> of 115,000 lines. There's the occasional "stutter" of a fraction of a
> >> second when I move across closed nodes containing large chunks, but it's
> >> still perfectly acceptable (to me, anyway!).
> >> 
> >> My PC is an Intel dual-core 2.66GHz with 4GB RAM, so nothing
> >> earth-shattering.
> >> 
I am have been seeing this for a while now on only one of about 8 
org files that I have, specifically the longest one which also has the 
most babel snippets (of pretty long sql). This behaviour is present on 
an Ubuntu VM with a scant 300Mbs as well as a Mac Pro with 6Gbs 
(although less of course). On the Ubuntu, I specifically see the CPU 
spike when typing! Very bizarre.
-C.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Slow movement in large buffers
  2011-05-11  0:41       ` Carmine Casciato
@ 2011-05-12  6:59         ` Eric S Fraga
  0 siblings, 0 replies; 26+ messages in thread
From: Eric S Fraga @ 2011-05-12  6:59 UTC (permalink / raw)
  To: Carmine Casciato; +Cc: emacs-orgmode

Carmine Casciato <casciato@gmail.com> writes:

[...]

> I am have been seeing this for a while now on only one of about 8 
> org files that I have, specifically the longest one which also has the 
> most babel snippets (of pretty long sql). This behaviour is present on 
> an Ubuntu VM with a scant 300Mbs as well as a Mac Pro with 6Gbs 
> (although less of course). On the Ubuntu, I specifically see the CPU 
> spike when typing! Very bizarre.
> -C.

What versions of org & emacs are you using?  Carsten recently (a month
ago or so?) put in a fix that seems to have addressed this problem, at
least for me.  I've been doing a lot of babel work lately and haven't
seen the slowdown since Carsten's fix.

Before this fix, the solution was to turn off mode specific fontification
of the source blocks: C-h v org-src-fontify-natively RET

HTH,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.274.gd6aba)

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2011-05-12  8:46 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-15  3:25 Slow movement in large buffers Matt Lundin
2011-03-15  5:03 ` Carsten Dominik
2011-03-15 12:51   ` Matt Lundin
2011-03-15 10:58 ` Eric S Fraga
2011-03-15 12:54   ` Matt Lundin
2011-03-15 14:09     ` Eric S Fraga
2011-03-15 17:42       ` Carsten Dominik
2011-03-15 11:18 ` Carsten Dominik
2011-03-15 12:33   ` Lawrence Mitchell
2011-03-15 12:50   ` Matt Lundin
2011-03-15 14:15   ` Nick Dokos
2011-03-15 15:51     ` Matt Lundin
2011-03-15 17:39       ` Carsten Dominik
2011-03-15 22:00       ` Christian Moe
2011-03-15 22:56         ` Nick Dokos
2011-03-15 23:13           ` Christian Moe
2011-03-16  3:48             ` Nick Dokos
2011-03-16  1:16           ` Bastien
2011-03-18  0:37             ` Matt Lundin
2011-03-15 16:11 ` Chris Randle
2011-03-15 16:41   ` MidLifeXis at PerlMonks
2011-03-15 17:14   ` Scott Randby
2011-03-15 17:18     ` Erik Iverson
2011-03-15 17:38     ` Carsten Dominik
2011-05-11  0:41       ` Carmine Casciato
2011-05-12  6:59         ` Eric S Fraga

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).