From: Dmitry Gutov <dgutov@yandex.ru>
To: Yuan Fu <casouri@gmail.com>
Cc: 60691-done@debbugs.gnu.org, juri@linkov.net
Subject: bug#60691: 29.0.60; Slow tree-sitter font-lock in ruby-ts-mode
Date: Wed, 1 Feb 2023 17:11:16 +0200 [thread overview]
Message-ID: <fa5eca86-0c6e-a656-6ddd-9537b04bb76d@yandex.ru> (raw)
In-Reply-To: <B199DD73-D908-4EB2-885E-FCD2D56C9AF7@gmail.com>
On 01/02/2023 07:26, Yuan Fu wrote:
>>> I should mention this in the comments, but the fast mode is only for very rare cases, where the file is mechanically generated and has some peculiarities that causes tree-sitter to work poorly. If the file is hand-written and “normal”, even huge files like xdisp.c is well below the bar. Therefore I don’t think “crossing the line” will realistically happen when editing source files.
>>> Here is the stats of two “problematic files”, named packet and dec_mask, comparing to xdisp.c:
>>> ;; max-depth max-width count
>>> ;; cut-off 100 4000
>>> ;; packet (98159 46581 1895137)
>>> ;; dec mask (3 64301 283995)
>>> ;; xdisp.c (29 985 218971)
>>> I’d say that any regular source file, even mechanically generated, wouldn’t go beyond ~50 levels in depth, and hand-written files should never has a node that has 4000+ direct children in the parse tree.
>> Oh, thanks for the explanation. Then the current strategy makes sense.
>>
>> Is xdisp.c absolutely the largest C file in your experience?
>>
>> According to the above numbers, a file that's only 4x as large could hit our current cutoff.
> I don’t think these stats increase linearly as the file size increases. Even if there is a file that has a node with 3999 direct children, and the developer adds another one, I’d say it’s better not to turn on “fast mode” immediately.
I see your point.
In the previous message I was talking about a different scenario: when a
project has a file 4x the size of xdisp.c, and the user just opens it. I
suspect it's not great to have "fast mode" enabled in that case? Like,
false positive.
Anyway, this is a very theoretical concern on my part.
prev parent reply other threads:[~2023-02-01 15:11 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-09 17:16 bug#60691: 29.0.60; Slow tree-sitter font-lock in ruby-ts-mode Juri Linkov
2023-01-09 22:33 ` Dmitry Gutov
2023-01-10 8:10 ` Juri Linkov
2023-01-10 14:10 ` Dmitry Gutov
2023-01-10 17:50 ` Juri Linkov
2023-01-11 12:12 ` Dmitry Gutov
2023-01-11 12:12 ` Dmitry Gutov
2023-01-12 21:58 ` Yuan Fu
2023-01-12 23:40 ` Dmitry Gutov
2023-01-13 7:57 ` Eli Zaretskii
2023-01-13 9:15 ` Yuan Fu
2023-01-13 11:51 ` Eli Zaretskii
2023-01-14 3:48 ` Yuan Fu
2023-01-14 7:29 ` Eli Zaretskii
2023-01-14 7:51 ` Yuan Fu
2023-01-14 8:01 ` Eli Zaretskii
2023-01-14 8:46 ` Andreas Schwab
2023-01-14 23:03 ` Yuan Fu
2023-01-18 6:50 ` Yuan Fu
2023-01-19 18:28 ` Dmitry Gutov
2023-01-20 22:24 ` Yuan Fu
2023-01-22 2:01 ` Dmitry Gutov
2023-01-29 8:25 ` Yuan Fu
2023-01-29 23:07 ` Dmitry Gutov
2023-01-29 23:23 ` Yuan Fu
2023-01-30 0:15 ` Dmitry Gutov
2023-02-01 5:26 ` Yuan Fu
2023-02-01 15:11 ` Dmitry Gutov [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fa5eca86-0c6e-a656-6ddd-9537b04bb76d@yandex.ru \
--to=dgutov@yandex.ru \
--cc=60691-done@debbugs.gnu.org \
--cc=casouri@gmail.com \
--cc=juri@linkov.net \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.