From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: spee-up table refresh Date: Mon, 09 Jan 2017 23:27:49 +0100 Message-ID: <58740E65.10509@free.fr> References: <587276BB.9000008@free.fr> <87pojxyw2t.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cQiQ2-0002aM-G8 for emacs-orgmode@gnu.org; Mon, 09 Jan 2017 17:27:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cQiPx-0003zd-Ih for emacs-orgmode@gnu.org; Mon, 09 Jan 2017 17:27:58 -0500 Received: from smtp3-g21.free.fr ([212.27.42.3]:59008) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cQiPx-0003z8-AV for emacs-orgmode@gnu.org; Mon, 09 Jan 2017 17:27:53 -0500 Received: from [IPv6:2a01:e35:2e21:def0:21bc:a51c:900e:b555] (unknown [IPv6:2a01:e35:2e21:def0:21bc:a51c:900e:b555]) by smtp3-g21.free.fr (Postfix) with ESMTP id 2ED4513F89E for ; Mon, 9 Jan 2017 23:27:50 +0100 (CET) In-Reply-To: <87pojxyw2t.fsf@nicolasgoaziou.fr> 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: emacs-orgmode@gnu.org Le 09/01/2017 00:24, Nicolas Goaziou a =E9crit : > Note that recalculating a table is inherently quadratic. Well, on the test-case your change made recalculation linear (which is good): | rows | seconds | |-------+---------| | 1000 | 1.5 | | 10000 | 13 | | 20000 | 25 | | 30000 | 37 | > >> 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=3D$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. > And you did so through an impressively light change: swapping two lines with a test on `suppress-analysis'. Thanks and regards. Thierry