emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Thierry Banel <tbanelwebmin@free.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: spee-up table refresh
Date: Mon, 09 Jan 2017 00:24:10 +0100	[thread overview]
Message-ID: <87pojxyw2t.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <587276BB.9000008@free.fr> (Thierry Banel's message of "Sun, 08 Jan 2017 18:28:27 +0100")

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

  reply	other threads:[~2017-01-08 23:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-08 17:28 spee-up table refresh Thierry Banel
2017-01-08 23:24 ` Nicolas Goaziou [this message]
2017-01-09 22:27   ` Thierry Banel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pojxyw2t.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=tbanelwebmin@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).