unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#60691: 29.0.60; Slow tree-sitter font-lock in ruby-ts-mode
@ 2023-01-09 17:16 Juri Linkov
  2023-01-09 22:33 ` Dmitry Gutov
                   ` (3 more replies)
  0 siblings, 4 replies; 28+ messages in thread
From: Juri Linkov @ 2023-01-09 17:16 UTC (permalink / raw)
  To: 60691; +Cc: dmitry gutov

X-Debbugs-Cc: Dmitry Gutov <dgutov@yandex.ru>

After more rules were added recently to ruby-ts--font-lock-settings,
font-lock became slow even on very small files.  Some measurements:

M-: (benchmark-run 1000 (progn (font-lock-mode -1) (font-lock-mode 1) (font-lock-ensure)))

M-x ruby-mode
(1.3564674989999999 0 0.0)

M-x ruby-ts-mode
(8.349582391999999 2 6.489918534000001)

This is not a problem when files are visited infrequently, but
becomes a problem for diff-syntax fontification that wants to
highlight simultaneously many files from git logs.
So a temporary measure would be not to enable ruby-ts-mode
in internal buffers:

(add-hook 'find-file-hook
          (lambda ()
            (when (and (eq major-mode 'ruby-mode)
                       ;; Only when not internal as from diff-syntax
                       (not (string-prefix-p " " (buffer-name))))
              (ruby-ts-mode))))





^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2023-02-01 15:11 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).