From mboxrd@z Thu Jan 1 00:00:00 1970 From: OSiUX Subject: Re: Bug?/performance issue in org-icalendar-export-current-agenda Date: Tue, 26 Aug 2014 15:10:54 -0300 Message-ID: <20140826181054.GA1059@localhost> References: <871ts3du98.fsf@berkeley.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AqsLC8rIMeq19msA" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMLD4-0001QH-94 for emacs-orgmode@gnu.org; Tue, 26 Aug 2014 14:11:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMLD0-0006rY-6t for emacs-orgmode@gnu.org; Tue, 26 Aug 2014 14:11:10 -0400 Received: from vodka.osiux.com ([96.8.118.129]:57430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMLD0-0006r2-1o for emacs-orgmode@gnu.org; Tue, 26 Aug 2014 14:11:06 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by vodka.osiux.com (Postfix) with ESMTPSA id CBD2E6D0806A for ; Tue, 26 Aug 2014 15:22:30 -0300 (ART) Content-Disposition: inline In-Reply-To: <871ts3du98.fsf@berkeley.edu> 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 --AqsLC8rIMeq19msA Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable El mar, 26 ago 2014, Richard Lawrence dec=C3=ADa: > Hi all, >=20 > 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. >=20 > My Emacs version is 23.4.1 and my Org version is "8.3beta" (I am > currently on commit 767895...) > =20 > 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. > =20 > 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: >=20 > ("Z" "Export to iCalendar file" tags "+event|+appointment" nil > ("~/Documents/website/public_html/lib/attachments/calendar.ics") >=20 > 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). >=20 > I have run some tests by manually setting org-agenda-files, then > building this agenda and eval'ing >=20 > (org-icalendar-export-current-agenda "/tmp/agenda.ics")=20 >=20 > in the agenda buffer. The results: >=20 > 1) Using just a simple three-entry test file, the export completes quickly > and I don't see the lockup. =20 > 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. =20 >=20 > 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. =20 >=20 > Thanks!=20 >=20 > --=20 > Best, > Richard I use a bash script: =3Dagenda-ascii=3D [0] to reduce the list of file to export, first =3Dgrep=3D current =3D/dev/null 2&>1 done fi #+END_EXAMPLE Actually the process, cosume 42%-97% CPU, for 526 appoinments, takes 0m 30.396s Org-mode version 8.3beta (release_8.3beta-264-g7a5f3f GNU Emacs 24.3.1 (x86_64-pc-linux-gnu) of 2014-06-06 on barber, modified = by Debian [0] https://github.com/osiris/org-bash-utils/blob/master/agenda-ascii --=20 :: Osiris Alejandro Gomez (OSiUX) osiux@osiux.com.ar DC44 95D2 0D5D D544 FC1A F00F B308 A671 9237 D36C http://www.osiux.com.ar http://www.altermundi.net --AqsLC8rIMeq19msA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJT/M2uAAoJELMIpnGSN9NsSb8P/jdHAjmefY5doQdU4vST/bV3 JEQ6B0Z/wvN35A8TlKFyrdAfLUrQmdad51vaguFeJpct9Bpc8CNfg3/MZ5Zng3Y6 liF8KuoN7Xa4IkA66pUjpQx/qwG90iu2CD4fFOXN0YAWrD6HSQ9jpiuBIJf7KmTt Z8b0H76QxhemL/Ejhy4rnRJu1EWPIKo5tUbQI9NfCMlRm/5fC512KfKz2eosmYhC c7ivEIt7XLZsxbJDk0nucPQpi+85Ll0c+l+eEwZ0z9Lwkxtzs+kwZFEImTnm7xVj tzdN6bWY8ecUXtTHSFKj8LrnXw659zLo7Z6/G/fvPKCmLgXnb3dTfpVJgCjUUEcn ZfUSBbkXT9kvD/5o9g8LXu2M5aU7URVdlfsWZ78vTe8FxgYQctsEIl9irt9CoypZ lTY1Ir/XV1ITki/p94Ii1x7tvoV9ysU+H9K90vOf6pUMQLLGB/kTRejjq/mdfUSy ArFrcwskbfCmBIyHVLUooLNYcqfmmxxniXVw093MXqHAmwT/co+DrbrbnmB9wJhX U/F0401gH1NFzfmhRpXql+oWg+WP8NLBXGt9ZKkDADecuAvWJngTMztr5dlIJUBK OHXb/sGjSNHWxoZZOcEJ1twxv9oilL8lhIZgHl8HwgBPpjm9AbD5PmEP7z/VFVeG xjiDrpG32No5ANmFybF6 =MEDV -----END PGP SIGNATURE----- --AqsLC8rIMeq19msA--