From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: spee-up table refresh Date: Mon, 09 Jan 2017 00:24:10 +0100 Message-ID: <87pojxyw2t.fsf@nicolasgoaziou.fr> References: <587276BB.9000008@free.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cQMp6-00058u-9m for emacs-orgmode@gnu.org; Sun, 08 Jan 2017 18:24:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cQMp1-00020f-F7 for emacs-orgmode@gnu.org; Sun, 08 Jan 2017 18:24:24 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:58366) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cQMp1-00020S-8Q for emacs-orgmode@gnu.org; Sun, 08 Jan 2017 18:24:19 -0500 In-Reply-To: <587276BB.9000008@free.fr> (Thierry Banel's message of "Sun, 08 Jan 2017 18:28:27 +0100") 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" To: Thierry Banel Cc: emacs-orgmode@gnu.org Hello, > I don't understand those 3 lines The prevent matching a table below #+begin_example | I'm not a table | #+end_example > without them (the 688 tests work as expected). Those lines indirectly > call (org-element--cache-put) a quadratic number of times. For a 1000 > rows table this is 501500 times (about 1000x1000/2 times). Note that recalculating a table is inherently quadratic. > Here is a test case. > > 1- First create a 1000 row table: > > #+BEGIN_SRC elisp :results none > (goto-char (point-max)) > (let ((i 1000)) > (while (> i 0) > (insert (format "| %4s | |\n" i)) > (setq i (1- i)))) > (insert "#+TBLFM: $2=$1*10\n") > #+END_SRC > > 2- Then, with point in the table, type C-u C-c * I limited calls to `org-element-at-point'. It should be much faster now. Thank you. Regards, -- Nicolas Goaziou