From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Performance problem when switching agenda views - need for cache? Date: Fri, 15 Jul 2011 16:10:51 -0400 Message-ID: <5990.1310760651@alphaville.americas.hpqcorp.net> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:60529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qhoiy-00053B-Pg for emacs-orgmode@gnu.org; Fri, 15 Jul 2011 16:11:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qhoit-0000Cy-3K for emacs-orgmode@gnu.org; Fri, 15 Jul 2011 16:10:59 -0400 Received: from g4t0017.houston.hp.com ([15.201.24.20]:46958) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qhois-0000Cf-KD for emacs-orgmode@gnu.org; Fri, 15 Jul 2011 16:10:54 -0400 In-Reply-To: Message from Rainer Stengele of "Fri, 15 Jul 2011 16:49:11 +0200." 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: Rainer Stengele Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org 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