Subject: Re: 29.0.50; [feature/tree-sitter] c-ts-mode fails to fontify a portion of a large C file

From: Theodor Thornhill <[email-masked]>
Date: Sun, 20 Nov 2022 22:56:12 +0100

>> 
>> I appreciate the explanation.  I think getting the root is a bit
>> excessive.  I got the same results as you in the capture.  Maybe reuse
>> the treesit-defun-type-regexp, and default to root if none found?
>
> I tried the "top-level node” approach, and it didn’t help in
> package-rrc.c: the top-level node (a function definition) is still too
> large (spans 7680306-9936062). Since the case I described in the
> comment against using treesit-node-on is the exception rather than the
> norm, maybe we can go the other way around: use treesit-node-on first,
> and if the node seems too small (by some heuristic), enlarge it to
> some degree.
>

Makes sense!

BTW, should the chunk-size of jit-lock be up for discussion again?  I
ran the benchmarks from this thread [0] on this file, and it seems like
increasing the chunk-size from 1500 to 4500 by 500 increments makes it
average from 2 seconds to 1.65.

The density of that file absolutely is a concern performance-wise.

Theo

[0]: https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg00538.html