From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Lawrence Subject: Bug?/performance issue in org-icalendar-export-current-agenda Date: Tue, 26 Aug 2014 10:40:35 -0700 Message-ID: <871ts3du98.fsf@berkeley.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMKl4-00089n-4k for emacs-orgmode@gnu.org; Tue, 26 Aug 2014 13:42:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMKkw-00060k-L7 for emacs-orgmode@gnu.org; Tue, 26 Aug 2014 13:42:14 -0400 Received: from plane.gmane.org ([80.91.229.3]:34652) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMKkw-00060a-Er for emacs-orgmode@gnu.org; Tue, 26 Aug 2014 13:42:06 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XMKkt-00031i-V8 for emacs-orgmode@gnu.org; Tue, 26 Aug 2014 19:42:03 +0200 Received: from 67.164.45.159 ([67.164.45.159]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Aug 2014 19:42:03 +0200 Received: from richard.lawrence by 67.164.45.159 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Aug 2014 19:42:03 +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 Hi all, I pulled from master recently (for the first time since the spring), and since the update, I have noticed a performance/lockup issue. The problem occurs when exporting an agenda view to iCalendar format. My Emacs version is 23.4.1 and my Org version is "8.3beta" (I am currently on commit 767895...) I have traced the problem down to a call to `org-icalendar-export-current-agenda', though I don't know if the problem is in this function or in another function called by it. Somewhere during the execution of this function, Emacs goes to 100% CPU usage (on one core) and memory usage starts growing until I kill the process. Here's what my setup looks like. I have just one entry in `org-agenda-custom-commands' that defines the files field. It looks like: ("Z" "Export to iCalendar file" tags "+event|+appointment" nil ("~/Documents/website/public_html/lib/attachments/calendar.ics") I normally only call this command via a cron job that exports my agenda files to .ics, which until recently was working fine. But I have noticed I can reproduce the lockup interactively by building an agenda view with this command, and then calling `org-icalendar-export-current-agenda' on it (which is also what happens, a few steps down the call chain, during the cron job). I have run some tests by manually setting org-agenda-files, then building this agenda and eval'ing (org-icalendar-export-current-agenda "/tmp/agenda.ics") in the agenda buffer. The results: 1) Using just a simple three-entry test file, the export completes quickly and I don't see the lockup. 2) Using an agenda file which contains plenty of real data (about 1000 lines) but no headlines tagged "event" or "appointment" (i.e., a file for which this agenda view is empty), the call to `org-icalendar-export-current-agenda' takes about 5 seconds to complete, even though there are no entries to export. During those 5 seconds, the Emacs process goes to 100% CPU usage. 3) Using a different agenda file (of about 4000 lines) which contains about 75 matching headlines, the call to `org-icalendar-export-current-agenda' does not complete within several minutes, during which time I see 100% CPU usage and rapid memory usage growth. So it looks to me like maybe some part of the export process uses exponentially more time and memory, depending on the input, since a minimal test case does not produce the problem. What's the next step for debugging this? Please let me know if I can provide more information. Thanks! -- Best, Richard