From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer Stengele Subject: Re: Performance problem when switching agenda views - need for cache? Date: Sat, 16 Jul 2011 00:21:47 +0200 Message-ID: <4E20BD7B.2050209@online.de> References: <5990.1310760651@alphaville.americas.hpqcorp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:50212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qhqle-0005bh-PI for emacs-orgmode@gnu.org; Fri, 15 Jul 2011 18:21:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qhqla-0003zW-2s for emacs-orgmode@gnu.org; Fri, 15 Jul 2011 18:21:54 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:64460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhqlZ-0003yI-E0 for emacs-orgmode@gnu.org; Fri, 15 Jul 2011 18:21:49 -0400 In-Reply-To: <5990.1310760651@alphaville.americas.hpqcorp.net> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org, Rainer Stengele Am 15.07.2011 22:10, schrieb Nick Dokos: > Rainer Stengele 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 > > > Nick, thanks for your analysis, my custom agenda command for the weekly agenda is this: ... ("07" "agenda no todos sorted prio up - 7 days" ((agenda ".. agenda" ( (org-agenda-ndays 7) (org-agenda-start-with-log-mode t) (org-agenda-overriding-header "Weekly Agenda")))) ((org-agenda-sorting-strategy '(time-up priority-down todo-state-up)))) ... the todo list ist default "C-c a t" It will not be easy to cut down my org files to smaller sizes. Best, - Rainer