From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: another example of org being slow, with some analysis Date: Fri, 19 Jun 2015 09:37:23 +0200 Message-ID: <871th86te4.fsf@selenimh.access.network> References: <87ioalhtfa.fsf@delle7240.chemeng.ucl.ac.uk> <87vbekc1iy.fsf@alphaville.usersys.redhat.com> <877fr0w78d.fsf@gelnhausen.dvs.informatik.tu-darmstadt.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5qqG-0007nc-7h for emacs-orgmode@gnu.org; Fri, 19 Jun 2015 03:36:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5qqE-0005Gj-5w for emacs-orgmode@gnu.org; Fri, 19 Jun 2015 03:36:00 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:41939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5qqD-0005De-PT for emacs-orgmode@gnu.org; Fri, 19 Jun 2015 03:35:57 -0400 In-Reply-To: <877fr0w78d.fsf@gelnhausen.dvs.informatik.tu-darmstadt.de> (Daniel Bausch's message of "Fri, 19 Jun 2015 08:19:14 +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: Daniel Bausch Cc: Nick Dokos , emacs-orgmode@gnu.org Hello, Daniel Bausch writes: > Line 6000 is indeed quite "lame". I have similar problems like Eric. A > table recalculation at line 43868 takes about a minute at my quite fast > machine. I also tracked that down to org-current-line. One interesting > detail is that this depends on the buffer encoding. With ASCII the > recalculation takes less than a second, with utf-8 about a minute. > > I think it actually is not an org-mode problem but depends on how > (count-lines 1 (point)) works, as it is using regex searches for the > line endings. I can imagine that the regex parser for utf-8 can be > inefficient. Actually `org-count-lines' and `org-goto-line' are inefficient functions. Unfortunately, Org Table overuses the latter. Functions calling it should be refactored to use, e.g., `goto-char' instead. However, this might require some deep changes in the library. Regards, -- Nicolas Goaziou