emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Max Nikulin <manikulin@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] C-c C-* causes "org-element--cache: Unregistered buffer modifications detected."
Date: Thu, 02 Dec 2021 09:48:30 +0800	[thread overview]
Message-ID: <87o85z7p5d.fsf@localhost> (raw)
In-Reply-To: <so7pmo$e7m$1@ciao.gmane.io>

Max Nikulin <manikulin@gmail.com> writes:

>> Well... I added yet another exception on main. Note that this special
>> case is also just in older Emacs versions.
>
> Ihor, have you pushed the change? I still can reproduce the issue with 
> Emacs-26.3

Oops. I fixed Emacs 27, but apparently not Emacs 26. Should be fixed
now.

>> (and I secretly hope that this kind of
>> patch will be implemented by someone else as a part of tree-sitter
>> integration).
>
> A piece of friendly trolling: it would be tree-sitter module for Org syntax.

tree-sitter is comparable with org-element. org-element
parser is fairly fast and also uses incremental parsing ;)

tree-sitter vs. org-element on 15M Org file
org-element-parse-buffer
(16.090262757 1 0.7365683609999962)

org-element-parse-buffer 'element granularity
(7.688000744 0 0.0)
8sec

tree-sitter via https://github.com/milisims/tree-sitter-org
parsed down to 58% of the buffer in 5.3sec and exited with error
extrapolates to ~9sec

Racket's brack via https://github.com/tgbugs/laundry
failed to finish parsing in reasonable time. Cancelled at 10m11.436s

Clojure parser via https://github.com/200ok-ch/org-parser
failed to finish parsing with java.lang.OutOfMemoryError: GC overhead limit exceeded
Running time 8m28.078s

So, tree-sitter may be faster, but not that much faster and we will have
communication overheads when using tree-sitter module.

>> The most problematic
>> is the case triggered by self-insert-command, but it will not trigger
>> cache reset.
>
> I mean namely this case of just typing text somewhere in a large file.

My data is for 15M file. Indeed, things will be worse for even larger
files, but let's hope that people's Org files are not yet that large and
we can wait until Emacs 28 is released.

Best,
Ihor



  reply	other threads:[~2021-12-02  1:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 11:40 Max Nikulin
2021-11-11 13:07 ` Ihor Radchenko
2021-11-14  7:59   ` Ihor Radchenko
2021-11-18 14:55     ` [BUG] " Max Nikulin
2021-11-21  8:35       ` Ihor Radchenko
2021-11-30 11:59         ` Max Nikulin
2021-11-30 12:54           ` Ihor Radchenko
2021-12-01 12:27             ` Max Nikulin
2021-12-02  1:48               ` Ihor Radchenko [this message]
2021-12-02 16:37                 ` Max Nikulin
2021-12-03  4:36                   ` Ihor Radchenko
2021-12-03 11:35                     ` Max Nikulin
2021-12-05  5:56                       ` Ihor Radchenko

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=87o85z7p5d.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=manikulin@gmail.com \
    --subject='Re: [BUG] C-c C-* causes "org-element--cache: Unregistered buffer modifications detected."' \
    /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

Code repositories for project(s) associated with this 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).