emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree-sitter integration on feature/tree-sitter


From: Eli Zaretskii
Subject: Re: Tree-sitter integration on feature/tree-sitter
Date: Wed, 11 May 2022 19:27:36 +0300

> From: Yoav Marco <yoavm448@gmail.com>
> Cc: casouri@gmail.com, emacs-devel@gnu.org
> Date: Wed, 11 May 2022 18:40:24 +0300
> 
> > So let's start with the benchmarks, and please tell what exactly did
> > Emacs do to trigger fontifications in each benchmark.
> 
> I called treesit-font-lock-fontify-region, which is the main function
> used for syntax highlighting in treesit as far as I'm aware.
> It's the value of font-lock-fontify-region-function after calling
> treesit-font-lock-enable.
> 
> (The code's attached in the original mail)

And the timings are in the table below?

  |   |                                      | no reuse (now) | reuse |
  | 1 | Fontify xdisp.c all at once          |          0.01s | 0.01s |
  | 2 | Fontify 60 next lines of xdisp.c ×10 |          0.10s | 0.00s |
  | 3 | Fontify 60 next lines till the end   |          6.06s | 0.01s |

If so, what is the significance of the last line in practical use
cases?  JIT font-lock never fontifies such large chunks of source
code, it does that in 512-character chunks, which is less than 60
lines in most cases, and definitely not "till the end".

Also, how much time does it take to do the same with the current
regexp- and syntax-based font-lock, for the same chunks of text?

We need to examine the use cases and the absolute numbers carefully
before we conclude that any kind of caching is needed and/or
justified.

Thanks.

P.S. If the above table is not the relevant benchmarks, please show
the URL of the message in the archive where you posted the relevant
benchmarks.



reply via email to

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