emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Performance problem when switching agenda views - need for cache


From: Nick Dokos
Subject: Re: [O] Performance problem when switching agenda views - need for cache?
Date: Fri, 15 Jul 2011 16:10:51 -0400

Rainer Stengele <address@hidden> wrote:


> Many a times I look at my weekly agenda view, working on the items of
> today and looking back over the weekdays to quickly find todos I have
> to to add further notes and clock times.
> 
> Now, sometimes I do not find the right todo in the weekly view, so I
> activate the list of all open todos in order to find the appropriate
> one.
> 
> This process, switching to "all todos" and back to "weekly agenda"
> takes about 18 (!) seconds netto.
> ...
> 
> org-agenda                                                    2           
> 17.624        8.812
> org-agenda-get-day-entries                                    64          
> 13.610000000  0.2126562500

Clearly, the 64 calls to org-agenda-get-day-entries hurt: a cursory look shows

,----
|     (while (setq d (pop day-numbers))
|       ...
|       (setq files thefiles
|           rtnall nil)
|       (while (setq file (pop files))
|            ...
|             (setq rtn (apply 'org-agenda-get-day-entries
|                              file date
|                              org-agenda-entry-types)))))
|            ...
`----

so it loops over all the days and for each day it loops over all the
files (7 days * 8 files = 56 times in org-agenda-list) - it "only" loops
over the 8 files for a given date in org-todo-list. So your normal
weekly agenda should take about 11 seconds or so (56/64 * 13) -
does it? If so, that's already too much.

Anything you can do to reduce the burden will help:
         
o reducing the number of days - nah
o reducing the number of files - maybe 
o reducing the size of each file - yes!

particularly this one:

  21567  169446 1524359 f4.org

which is 5x bigger than any of the others. You might just try leaving out
of the agenda file list, just to see what effect it has.

> org-agenda-run-series                                         1           
> 11.812        11.812

Another thing that makes a difference is your
org-agenda-custom-commands: afaict, this function is only called if
org-agenda-custom-commands has an entry with a series of commands
associated with it: the function runs overs the series of commands. I
could try to deduce/guess what's in there, but it would be simpler if
you just tell us :-) In any case, that's also a time hog.

> org-agenda-list                                               1           
> 10.921        10.921
> org-let2                                                      1           
> 10.921        10.921
> org-agenda-get-scheduled                                      56          
> 7.284         0.1300714285
> org-todo-list                                                 1           
> 5.281         5.281
> org-agenda-get-todos                                          8           
> 3.594         0.44925
> ...

Nick




reply via email to

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