From mboxrd@z Thu Jan 1 00:00:00 1970 From: coroa@online.de (Jonas =?utf-8?Q?H=C3=B6rsch?=) Subject: Switch org-agenda-get-* defuns to operate on date ranges Date: Mon, 20 May 2013 15:36:06 +0200 Message-ID: <87ppwlzsc9.fsf@kafka.loc> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UeQGG-0004nz-Kf for emacs-orgmode@gnu.org; Mon, 20 May 2013 09:36:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UeQGD-0002jX-B1 for emacs-orgmode@gnu.org; Mon, 20 May 2013 09:36:24 -0400 Received: from plane.gmane.org ([80.91.229.3]:35191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UeQGD-0002jJ-4f for emacs-orgmode@gnu.org; Mon, 20 May 2013 09:36:21 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UeQGA-0007xJ-Kg for emacs-orgmode@gnu.org; Mon, 20 May 2013 15:36:18 +0200 Received: from dslb-178-008-211-072.pools.arcor-ip.net ([178.8.211.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 20 May 2013 15:36:18 +0200 Received: from coroa by dslb-178-008-211-072.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 20 May 2013 15:36:18 +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: emacs-orgmode@gnu.org Cc: Florian Friesdorf hello everyone, i've just started to use calfw to get a nice calendar-like display of my agenda. unfortunately i was slighly dismayed at the build-up speed easily exceeding a few seconds on my not so packed schedule. profiling into the code i found that the problem mainly is: there exists only the possibility to retrieve agenda data for one day day, org-agenda.el's org-agenda-get-day-entries, rather than for a range of days. this makes it necessary to loop over --get-day-entries to collect all entries to show in the monthly calendar. --get-day-entries for its part has to parse (basically regex-search through) the respective org agenda file completely on each invocation; effectively done by org-agenda-get-{todos,blocks,sexps,...}. i imagine it is quite feasible to implement (defun org-agenda-get-entries (file beg end &rest args) ...) to sift through FILE but once and return an alist like ((date . (entry1 entry2 ..)) ..) containing all entries between dates BEG and END, inclusive. neglecting the extra overhead for sorting entries into the alist, this promises to speed up typical weekly agenda collection by a factor of 7 and calfw even by a factor of approx. 30, shouldn't it? before i start a local branch to try myself on this refactoring work, i'd welcome a few comments, why i should be likely to fail or succeed! cheers, jonas