[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reliable after-change-functions (via: Using incremental parsing in E
From: |
Eli Zaretskii |
Subject: |
Re: Reliable after-change-functions (via: Using incremental parsing in Emacs) |
Date: |
Tue, 31 Mar 2020 20:48:14 +0300 |
> From: Stefan Monnier <address@hidden>
> Cc: Dmitry Gutov <address@hidden>, address@hidden, address@hidden,
> address@hidden
> Date: Tue, 31 Mar 2020 13:16:33 -0400
>
> > It should be obvious that sending a buffer as a single string is less
> > efficient than letting tree-sitter access buffer text directly. We
> > just need an appropriate API for that (maybe there is one already, I
> > didn't take a look at their sources since January).
>
> My benchmark say that `buffer-string` takes about 1/3 the time of
> `parse-partial-sexp`, so letting tree-sitter access our buffer text
> directly is unlikely to give more than a 30% speed up.
Sure, but we never call parse-partial-sexp on the entire buffer, do
we?
> It doesn't mean it wouldn't be a desirable optimization, but it does
> mean that it likely won't make a large difference as to whether it's
> "fast enough".
I disagree. Communicating with a C library by making a string out of
buffer text is extremely inelegant and inefficient. We shouldn't do
that except when the strings are very short.
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), (continued)
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Stephen Leake, 2020/03/31
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Stefan Monnier, 2020/03/30
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Štěpán Němec, 2020/03/30
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Eli Zaretskii, 2020/03/30
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Stefan Monnier, 2020/03/30
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Eli Zaretskii, 2020/03/31
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Dmitry Gutov, 2020/03/31
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Eli Zaretskii, 2020/03/31
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Dmitry Gutov, 2020/03/31
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Stefan Monnier, 2020/03/31
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs),
Eli Zaretskii <=
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Stefan Monnier, 2020/03/31
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Eli Zaretskii, 2020/03/31
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Stefan Monnier, 2020/03/31
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Eli Zaretskii, 2020/03/31
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Stefan Monnier, 2020/03/31
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Jorge Javier Araya Navarro, 2020/03/31
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Eli Zaretskii, 2020/03/31
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), 조성빈, 2020/03/31
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Eli Zaretskii, 2020/03/31
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Dmitry Gutov, 2020/03/31