Re: [O] Slow movement in large buffers

2011-05-12 Thread Eric S Fraga
Carmine Casciato casci...@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)



Re: [O] Slow movement in large buffers

2011-05-10 Thread Carmine Casciato
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.





Re: [O] Slow movement in large buffers

2011-03-15 Thread Eric S Fraga
Matt Lundin m...@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)



Re: [O] Slow movement in large buffers

2011-03-15 Thread Carsten Dominik

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






Re: [O] Slow movement in large buffers

2011-03-15 Thread Lawrence Mitchell
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 we...@gmx.li




Re: [O] Slow movement in large buffers

2011-03-15 Thread Nick Dokos
Carsten Dominik carsten.domi...@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



Re: [O] Slow movement in large buffers

2011-03-15 Thread Chris Randle

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



Re: [O] Slow movement in large buffers

2011-03-15 Thread MidLifeXis at PerlMonks
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 ch...@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



Re: [O] Slow movement in large buffers

2011-03-15 Thread Scott Randby
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



Re: [O] Slow movement in large buffers

2011-03-15 Thread Erik Iverson

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




Re: [O] Slow movement in large buffers

2011-03-15 Thread Carsten Dominik

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
 




Re: [O] Slow movement in large buffers

2011-03-14 Thread Carsten Dominik
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