[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#60691: 29.0.60; Slow tree-sitter font-lock in ruby-ts-mode
From: |
Juri Linkov |
Subject: |
bug#60691: 29.0.60; Slow tree-sitter font-lock in ruby-ts-mode |
Date: |
Mon, 09 Jan 2023 19:16:12 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) |
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))))
- bug#60691: 29.0.60; Slow tree-sitter font-lock in ruby-ts-mode,
Juri Linkov <=
bug#60691: 29.0.60; Slow tree-sitter font-lock in ruby-ts-mode, Yuan Fu, 2023/01/12