Re: [O] slow agenda view and scrolling through headlines

2011-11-15 Thread Carsten Dominik

On Nov 15, 2011, at 7:45 AM, Viktor Rosenfeld wrote:

> Hi Susan,
> 
> swapping on OS X is usually accompanied by the spinning beach ball (from
> hell).
> 
> Have you tried upgrading Emacs? I use Aquamacs (http://aquamacs.org/),
> there's also Cocoa Emacs (http://emacsformacosx.com/). Both are based on
> Emacs 23.3.


Upgrading is certainly worth trying.  Any obstacles agains doing that?


It should be no need to reformat the files. If it can be fast, it
should be fast, and if it get slow, this must mean that something
is wrong - either in Emacs or in Org.

Sometimes too many overlays can cause these problems.  Maybe you can try
these when it is slow:

1. Try to close all org-buffers before making the agenda.
   Does this help, maybe already on the first creation of
   the agenda, but certainly on the second?

2. Another try could be to cycle all Org buffer through
   visibility (three times S-TAB in each buffer).  Does that
   make a difference?

Mind you, this is not for everyday operations, but to help us
find out what is wrong.

- Carsten

> 
> Cheers,
> Viktor
> 
> Susan Addy wrote:
> 
>> Also - it does not usually get faster right after it gets slower. It will
>> stay slow for a while and sometimes get faster again later, but I haven't
>> noticed a definite pattern.
>> 
>> 
>> On Mon, Nov 14, 2011 at 7:44 PM, Susan Addy  wrote:
>> 
>>> Hi Nick,
>>>   I'm not sure if the machine swaps - in fact I'm not sure what you mean.
>>> However, I am on a macbook air running OSX 10.6.8, emacs 22.3.1, org 7.7. I
>>> am the only user. I have 4GB ram, 2.13 GHz intel core 2 duo.
>>> Thanks for your help,
>>>Susan
>>> 
>>> 
>>> On Sun, Nov 13, 2011 at 9:41 PM, Nick Dokos  wrote:
>>> 
 Susan Addy  wrote:
 
> Ok - I tried adding (setq font-lock-verbose nil), but there was no
> change. It is still fast when I open emacs, and then some time later
> (after I switch to another program for some time and back) it is
> slow. Sometimes it will become fast again, and sometimes I recall (I
> think) it has been slow right when I open it.
> 
> Also, to clarify, the slow scrolling through headlines is in normal
> view, not agenda view. It tends to be correlated with the agenda being
> slow.
> 
 
 Could it be that emacs is swapped out after you leave it for a while and
 it takes a long time to get swapped back in? But if so, it would get
 faster soon thereafter. Does the machine swap at all?
 
 OS and version? org version? emacs version? do you share the machine or
 are you the
 only user on it? how much memory? CPUs?
 
 Nick
 
>>> 
>>> 
> 

- Carsten






Re: [O] slow agenda view and scrolling through headlines

2011-11-14 Thread Viktor Rosenfeld
Hi Susan,

swapping on OS X is usually accompanied by the spinning beach ball (from
hell).

Have you tried upgrading Emacs? I use Aquamacs (http://aquamacs.org/),
there's also Cocoa Emacs (http://emacsformacosx.com/). Both are based on
Emacs 23.3.

Cheers,
Viktor

Susan Addy wrote:

> Also - it does not usually get faster right after it gets slower. It will
> stay slow for a while and sometimes get faster again later, but I haven't
> noticed a definite pattern.
> 
> 
> On Mon, Nov 14, 2011 at 7:44 PM, Susan Addy  wrote:
> 
> > Hi Nick,
> >I'm not sure if the machine swaps - in fact I'm not sure what you mean.
> > However, I am on a macbook air running OSX 10.6.8, emacs 22.3.1, org 7.7. I
> > am the only user. I have 4GB ram, 2.13 GHz intel core 2 duo.
> >  Thanks for your help,
> > Susan
> >
> >
> > On Sun, Nov 13, 2011 at 9:41 PM, Nick Dokos  wrote:
> >
> >> Susan Addy  wrote:
> >>
> >> > Ok - I tried adding (setq font-lock-verbose nil), but there was no
> >> > change. It is still fast when I open emacs, and then some time later
> >> > (after I switch to another program for some time and back) it is
> >> > slow. Sometimes it will become fast again, and sometimes I recall (I
> >> > think) it has been slow right when I open it.
> >> >
> >> > Also, to clarify, the slow scrolling through headlines is in normal
> >> > view, not agenda view. It tends to be correlated with the agenda being
> >> > slow.
> >> >
> >>
> >> Could it be that emacs is swapped out after you leave it for a while and
> >> it takes a long time to get swapped back in? But if so, it would get
> >> faster soon thereafter. Does the machine swap at all?
> >>
> >> OS and version? org version? emacs version? do you share the machine or
> >> are you the
> >> only user on it? how much memory? CPUs?
> >>
> >> Nick
> >>
> >
> >



Re: [O] slow agenda view and scrolling through headlines

2011-11-14 Thread Nick Dokos
Susan Addy  wrote:

> In your opinion, can I rule out the idea that I have too many
> headlines or to many TODOs since it is sometimes fast? Is there
> anything to suggest that I might reformat my files? 

I don't know - but I think it's too early to start changing
files if you don't have any idea about what causes the slowdown.

I had send a set of suggestions and questions in another email:
what agenda command are you using? and can you limit the list
of agenda files to each file in turn? The idea was to see if
there was *one* file that caused the slowness and try to
get a clue from that.

Nick



Re: [O] slow agenda view and scrolling through headlines

2011-11-14 Thread Susan Addy
Thanks Nick.

In your opinion, can I rule out the idea that I have too many headlines or
to many TODOs since it is sometimes fast? Is there anything to suggest that
I might reformat my files?

Thanks,
   Susan

On Mon, Nov 14, 2011 at 8:20 PM, Nick Dokos  wrote:

> Susan Addy  wrote:
>
>
> >I'm not sure if the machine swaps - in fact I'm not sure what you
> > mean. However, I am on a macbook air running OSX 10.6.8, emacs 22.3.1,
> > org 7.7. I am the only user. I have 4GB ram, 2.13 GHz intel core 2
> > duo.
>
> It probably does not swap then: you would know if it did :-)
> The telltale sign is that the disk would be active all the time.
>
> Not sure what OSX has for monitoring: I usually use vmstat
> to check things like this (or the gnome system monitor applet).
>
> In any case, it was a shot in the dark, since there is very
> little light here :-)
>
> Nick
>
>
>
>
>


Re: [O] slow agenda view and scrolling through headlines

2011-11-14 Thread Nick Dokos
Susan Addy  wrote:


>    I'm not sure if the machine swaps - in fact I'm not sure what you
> mean. However, I am on a macbook air running OSX 10.6.8, emacs 22.3.1,
> org 7.7. I am the only user. I have 4GB ram, 2.13 GHz intel core 2
> duo.

It probably does not swap then: you would know if it did :-)
The telltale sign is that the disk would be active all the time.

Not sure what OSX has for monitoring: I usually use vmstat
to check things like this (or the gnome system monitor applet).

In any case, it was a shot in the dark, since there is very
little light here :-)

Nick







Re: [O] slow agenda view and scrolling through headlines

2011-11-14 Thread Susan Addy
Also - it does not usually get faster right after it gets slower. It will
stay slow for a while and sometimes get faster again later, but I haven't
noticed a definite pattern.


On Mon, Nov 14, 2011 at 7:44 PM, Susan Addy  wrote:

> Hi Nick,
>I'm not sure if the machine swaps - in fact I'm not sure what you mean.
> However, I am on a macbook air running OSX 10.6.8, emacs 22.3.1, org 7.7. I
> am the only user. I have 4GB ram, 2.13 GHz intel core 2 duo.
>  Thanks for your help,
> Susan
>
>
> On Sun, Nov 13, 2011 at 9:41 PM, Nick Dokos  wrote:
>
>> Susan Addy  wrote:
>>
>> > Ok - I tried adding (setq font-lock-verbose nil), but there was no
>> > change. It is still fast when I open emacs, and then some time later
>> > (after I switch to another program for some time and back) it is
>> > slow. Sometimes it will become fast again, and sometimes I recall (I
>> > think) it has been slow right when I open it.
>> >
>> > Also, to clarify, the slow scrolling through headlines is in normal
>> > view, not agenda view. It tends to be correlated with the agenda being
>> > slow.
>> >
>>
>> Could it be that emacs is swapped out after you leave it for a while and
>> it takes a long time to get swapped back in? But if so, it would get
>> faster soon thereafter. Does the machine swap at all?
>>
>> OS and version? org version? emacs version? do you share the machine or
>> are you the
>> only user on it? how much memory? CPUs?
>>
>> Nick
>>
>
>


Re: [O] slow agenda view and scrolling through headlines

2011-11-14 Thread Susan Addy
Hi Nick,
   I'm not sure if the machine swaps - in fact I'm not sure what you mean.
However, I am on a macbook air running OSX 10.6.8, emacs 22.3.1, org 7.7. I
am the only user. I have 4GB ram, 2.13 GHz intel core 2 duo.
 Thanks for your help,
Susan

On Sun, Nov 13, 2011 at 9:41 PM, Nick Dokos  wrote:

> Susan Addy  wrote:
>
> > Ok - I tried adding (setq font-lock-verbose nil), but there was no
> > change. It is still fast when I open emacs, and then some time later
> > (after I switch to another program for some time and back) it is
> > slow. Sometimes it will become fast again, and sometimes I recall (I
> > think) it has been slow right when I open it.
> >
> > Also, to clarify, the slow scrolling through headlines is in normal
> > view, not agenda view. It tends to be correlated with the agenda being
> > slow.
> >
>
> Could it be that emacs is swapped out after you leave it for a while and
> it takes a long time to get swapped back in? But if so, it would get
> faster soon thereafter. Does the machine swap at all?
>
> OS and version? org version? emacs version? do you share the machine or
> are you the
> only user on it? how much memory? CPUs?
>
> Nick
>


Re: [O] slow agenda view and scrolling through headlines

2011-11-13 Thread Nick Dokos
Susan Addy  wrote:

> Ok - I tried adding (setq font-lock-verbose nil), but there was no
> change. It is still fast when I open emacs, and then some time later
> (after I switch to another program for some time and back) it is
> slow. Sometimes it will become fast again, and sometimes I recall (I
> think) it has been slow right when I open it. 
> 
> Also, to clarify, the slow scrolling through headlines is in normal
> view, not agenda view. It tends to be correlated with the agenda being
> slow. 
> 

Could it be that emacs is swapped out after you leave it for a while and
it takes a long time to get swapped back in? But if so, it would get
faster soon thereafter. Does the machine swap at all?

OS and version? org version? emacs version? do you share the machine or are you 
the
only user on it? how much memory? CPUs?

Nick



Re: [O] slow agenda view and scrolling through headlines

2011-11-13 Thread Susan Addy
Ok - I tried adding (setq font-lock-verbose nil), but there was no change.
It is still fast when I open emacs, and then some time later (after I
switch to another program for some time and back) it is slow. Sometimes it
will become fast again, and sometimes I recall (I think) it has been slow
right when I open it.

Also, to clarify, the slow scrolling through headlines is in normal view,
not agenda view. It tends to be correlated with the agenda being slow.

   Thanks,
  Susan

On Sun, Nov 13, 2011 at 2:58 PM, Nick Dokos  wrote:

> Susan Addy  wrote:
>
> > Thanks Bernt. I checked and Linum-mode is not enabled.
> >
> > Also, I using emacs 22.3.1 and org-mode 7.7 (if it helps).
> >
> >
> > On Sun, Nov 13, 2011 at 2:16 PM, Bernt Hansen  wrote:
> >
> > Susan Addy  writes:
> >
> > > Below is a list of my agenda command - maybe it is too long? When
> it
> > > is slow, it is slow no matter what TODO I am trying to compile.
> > >
> > > Any thoughts?
> > > Thank you!
> >
> > If you have linum-mode enabled you should turn that off.  Others have
> > reported slow navigation when that is enabled.
> >
> > HTH,
> > Bernt
> >
> >
>
> There have been various discussions on agenda slowness in the past -
> check the mailing list for some guesses (linum-mode, font-lock, property
> inheritance, code compilation and perhaps others have been suggested as
> possible causes). Sometimes the guesses pan out, sometimes not.
>
> The most important thing you can do, imo, is to profile the code, first
> when it's behaving well and then when it's behaving badly.
>
> All you have to do is
>
>M-x elp-instrument-package RET org RET
>
> run your agenda command and then
>
>M-x elp-results RET
>
> to get the results.
>
> Nick
>


Re: [O] slow agenda view and scrolling through headlines

2011-11-13 Thread Susan Addy
I don't think so. I just restarted emacs and compiled the agenda about 15
times in a row and it was fast. But - if I leave it to do something else
for a while, often the next time I compile agenda it is slow, even if I
haven't changed the org mode agenda files in the meantime.

  Thanks again.

On Sun, Nov 13, 2011 at 5:49 PM, Samuel Wales  wrote:

> Does it slow down depending on the number of times you run agenda?
>


Re: [O] slow agenda view and scrolling through headlines

2011-11-13 Thread Susan Addy
Hi Nick,
I have looked through the archives and tried what I found, including
the linum-mode and property-inheritance, which didn't affect the problem. I
also tried to change to the latest version of org mode and (I think) emacs,
which didn't help. I don't recall seeing the font-lock problem, though I
may have tried it earlier. I'll look for that one again. Most of the
archive questions had a slow agenda all the time, and not only sometimes.

   I tried your commands below (thank you!) and have some interesting
results, but I don't know enough to interpret them. If I am interpreting
right, org-scan-tags  sometimes takes much longer, but I have no idea why
it would be fast sometimes and slow others.

Here are the top 10 listings when operation is fast (about 3 seconds)

Function Name Call Count
Elapsed Time  Average Time

  ==

org-agenda1
1.943013  1.943013

org-agenda-run-series 1
1.590022  1.590022

org-let2  2
1.161017  0.580508

org-tags-view 1
0.826727  0.826727

org-scan-tags 5
0.760431  0.1520862

org-let   2
0.426281  0.2131405

org-agenda-get-restriction-and-command1
0.35290.3529

org-agenda-list   1
0.334261  0.334261

org-prepare-agenda-buffers2
0.326487  0.163243

org-prepare-agenda3
0.311333  0.103777

org-get-entries-from-diary1
0.266385  0.26638


When agenda is slow:

Function Name Call
Count  Elapsed Time  Average Time

  ==

org-agenda1
12.133429 12.133429

org-agenda-run-series 1
11.768025 11.768025

org-let2  2
10.856247999  5.428123

org-tags-view 1
10.427989 10.427989

org-scan-tags 5
10.402578000  2.0805156000

org-let   2
0.908944  0.454472

org-finalize-agenda   3
0.817623  0.272541

org-agenda-get-day-entries10
0.684588  0.0684588999

org-agenda-get-scheduled  10
0.444710  0.0444711

org-agenda-list   1
0.428234  0.428234

On Sun, Nov 13, 2011 at 2:58 PM, Nick Dokos  wrote:

> Susan Addy  wrote:
>
> > Thanks Bernt. I checked and Linum-mode is not enabled.
> >
> > Also, I using emacs 22.3.1 and org-mode 7.7 (if it helps).
> >
> >
> > On Sun, Nov 13, 2011 at 2:16 PM, Bernt Hansen  wrote:
> >
> > Susan Addy  writes:
> >
> > > Below is a list of my agenda command - maybe it is too long? When
> it
> > > is slow, it is slow no matter what TODO I am trying to compile.
> > >
> > > Any thoughts?
> > > Thank you!
> >
> > If you have linum-mode enabled you should turn that off.  Others have
> > reported slow navigation when that is enabled.
> >
> > HTH,
> > Bernt
> >
> >
>
> There have been various discussions on agenda slowness in the past -
> check the mailing list for some guesses (linum-mode, font-lock, property
> inheritance, code compilation and perhaps others have been suggested as
> possible causes). Sometimes the guesses pan out, sometimes not.
>
> The most important thing you can do, imo, is to profile the code, first
> when it's behaving well and then when it's behaving badly.
>
> All you have to do is
>
>M-x elp-instrument-package RET org RET
>
> run your agenda command and then
>
>M-x elp-results RET
>
> to get the results.
>
> Nick
>


Re: [O] slow agenda view and scrolling through headlines

2011-11-13 Thread Samuel Wales
Does it slow down depending on the number of times you run agenda?



Re: [O] slow agenda view and scrolling through headlines

2011-11-13 Thread Nick Dokos
Susan Addy  wrote:

> Thanks Bernt. I checked and Linum-mode is not enabled. 
>   
> Also, I using emacs 22.3.1 and org-mode 7.7 (if it helps). 
>  
> 
> On Sun, Nov 13, 2011 at 2:16 PM, Bernt Hansen  wrote:
> 
> Susan Addy  writes:
>
> > Below is a list of my agenda command - maybe it is too long? When it
> > is slow, it is slow no matter what TODO I am trying to compile.
> >
> > Any thoughts? 
> > Thank you!
>
> If you have linum-mode enabled you should turn that off.  Others have
> reported slow navigation when that is enabled.
>
> HTH,
> Bernt
> 
> 

There have been various discussions on agenda slowness in the past -
check the mailing list for some guesses (linum-mode, font-lock, property
inheritance, code compilation and perhaps others have been suggested as
possible causes). Sometimes the guesses pan out, sometimes not.

The most important thing you can do, imo, is to profile the code, first
when it's behaving well and then when it's behaving badly.

All you have to do is

M-x elp-instrument-package RET org RET

run your agenda command and then

M-x elp-results RET

to get the results. 

Nick



Re: [O] slow agenda view and scrolling through headlines

2011-11-13 Thread Susan Addy
Thanks Bernt. I checked and Linum-mode is not enabled.

Also, I using emacs 22.3.1 and org-mode 7.7 (if it helps).


On Sun, Nov 13, 2011 at 2:16 PM, Bernt Hansen  wrote:

> Susan Addy  writes:
>
> > Below is a list of my agenda command - maybe it is too long? When it
> > is slow, it is slow no matter what TODO I am trying to compile.
> >
> > Any thoughts?
> > Thank you!
>
> If you have linum-mode enabled you should turn that off.  Others have
> reported slow navigation when that is enabled.
>
> HTH,
> Bernt
>


Re: [O] slow agenda view and scrolling through headlines

2011-11-13 Thread Bernt Hansen
Susan Addy  writes:

> Below is a list of my agenda command - maybe it is too long? When it
> is slow, it is slow no matter what TODO I am trying to compile.
>
> Any thoughts? 
> Thank you!

If you have linum-mode enabled you should turn that off.  Others have
reported slow navigation when that is enabled.

HTH,
Bernt



[O] slow agenda view and scrolling through headlines

2011-11-13 Thread Susan Addy
I am an avid user of org mode for all of my notes (usually kept under
headlines with dates) and TODOs. I now have 5 agenda files with a total of
about 25,000 lines, about 25% of which are headlines.

Sometimes, when I run agenda, it is very slow to compile - about 10-15
seconds. During these times, it is also slow to scroll through the high
level headings (about 5-6 seconds each to get to the next heading).
However, others times, the same commands are much faster - 2 seconds to
compile the agenda and an immediate response when scrolling. I can't find a
pattern to when it is slow versus fast. It is usually fast the first time I
open emacs, even if I just restarted the computer and opened emacs. It
doesn't seem to matter what else is running on the computer. Sometimes it
stays fast for several hours, and then all of sudden will be slow - even if
nothing has been added to the file in the meantime.

I've considered some major changes to try and fix this, like converting all
of my headlines that don't have todo items (i.e. notes that start with a
date) to a list instead of a headline. I've also considered trying to use
the logbook for notes instead of headlines. However, if it is just having
trouble scanning through so many headlines, I don't understand why it can
compile the agenda fast some times and not others. I also don't know if
scroll would be any faster, because the same number of lines would still be
there.  If scroll was always slow at first and then fast later, that might
make sense too (maybe it is remembering some of the structure after the
first scroll?).

Below is a list of my agenda command - maybe it is too long? When it is
slow, it is slow no matter what TODO I am trying to compile.

Any thoughts?
Thank you!

(setq org-agenda-custom-commands
  '(("d" "Daily Action List (work)"
 ((agenda "" ((org-agenda-ndays 5)
  (org-deadline-warning-days 0)
  (org-agenda-repeating-timestamp-show-all t)
  (org-agenda-skip-scheduled-if-done nil)
("n" "NextActions List (work)"
 ((agenda "" ((org-agenda-ndays 1)
  (org-use-tag-inheritance nil)
  (org-agenda-repeating-timestamp-show-all t)))
  (tags-todo "work+TODO=\"NEXTACTION\""
 ((org-agenda-skip-function
  '(org-agenda-skip-entry-if 'scheduled))
("p" "Active Projects List (work)"
 ((tags-todo "work/PRJ"
 ((org-agenda-skip-function '(org-agenda-skip-entry-if
  'scheduled))
  
("o" "Ongoing Projects List (work)"
 ((tags-todo "work/ONGOING"
 ((org-agenda-skip-function '(org-agenda-skip-entry-if
  'scheduled))  
("w" "Waiting For List (work)"
 ((tags-todo "work/WAITING")))
("s" "Someday/Maybe List (work)"
 ((tags-todo "work/SOMEDAY" )))
("y" "Delegated Projects (work)"
 ((tags-todo "work/YOUDO")))
("H" "How To List"
 ((tags "HowTo")))
("g" "Things to google"
 ((tags "google")))
 ("a" "agendas (work)"
 ((tags-todo "work/AGENDA"
 ((org-agenda-skip-function '(org-agenda-skip-entry-if
  'scheduled))
  
("N" "NextActions List (home)"
 ((agenda "" ((org-agenda-ndays 1)
  (org-agenda-repeating-timestamp-show-all t)))
  (tags-todo
   "home+TODO=\"NEXTACTION\""
   ((org-agenda-skip-function '(org-agenda-skip-entry-if
'scheduled))  
 ("P" "Active Projects List (home)"
 ((tags-todo "home/PRJ"
 ((org-agenda-skip-function '(org-agenda-skip-entry-if
  'scheduled))
  
("O" "Ongoing Projects List (home)"
 ((tags-todo "home/ONGOING"
 ((org-agenda-skip-function '(org-agenda-skip-entry-if
  'scheduled))  
 ("W" "Waiting For List (home)"
 ((tags-todo "home/WAITING")))
 ("S" "Someday/Maybe List (home)"
 ((tags-todo "home/SOMEDAY" )))
 ("Y" "Delegated Projects (home)"
 ((tags-todo "home/YOUDO")))
 ("A" "agendas (home)"
 ((tags-todo "home/AGENDA"
 ((org-agenda-skip-function '(org-agenda-skip-entry-if
  'scheduled))
  
))