[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] spee-up table refresh

From: Nicolas Goaziou
Subject: Re: [O] spee-up table refresh
Date: Mon, 09 Jan 2017 00:24:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)


> I don't understand those 3 lines

The prevent matching a table below

  | I'm not a table |
> 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")
> 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.


Nicolas Goaziou

reply via email to

[Prev in Thread] Current Thread [Next in Thread]