GNU bug report logs -
#78697
`treesit-major-mode-setup` causing substantial pause when finding a file
Previous Next
Full log
Message #20 received at 78697 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Oh, I did want to mention that while on Linux I didn't notice much of an improvement using MPS, on Mac OS, going from regular Emacs to the feature/igc branch eliminated a huge amount of very long and constant random pauses and made it much, much faster. And I haven't run into any bugs or issues with it still.
On Thursday, June 5th, 2025 at 2:04 PM, alexis purslane <alexispurslane <at> pm.me> wrote:
> Yeah, looking at the new profiles made me realize that too, so I submitted it before responding. In case you want to follow the issue: https://github.com/clojure-emacs/clojure-ts-mode/issues/109
>
> On Thursday, June 5th, 2025 at 2:03 PM, Eli Zaretskii eliz <at> gnu.org wrote:
>
> > > Date: Thu, 05 Jun 2025 13:55:05 +0000
> > > From: alexis purslane alexispurslane <at> pm.me
> > > Cc: 78697 <at> debbugs.gnu.org
> > >
> > > I don't have the original profile anymore, but it was easy enough to reproduce. Here's that reproduced version:
> > >
> > > 481 80% - command-execute
> > > 481 80% - funcall-interactively
> > > 481 80% - god-mode-self-insert
> > > 262 44% - funcall-interactively
> > > 261 43% - project-find-file
> > > 261 43% - project-find-file-in
> > > 205 34% - find-file
> > > 205 34% - find-file-noselect
> > > 202 34% - find-file-noselect-1
> > > 200 33% - after-find-file
> > > 195 32% - normal-mode
> > > 189 31% - set-auto-mode
> > > 188 31% - set-auto-mode--apply-alist
> > > 188 31% - set-auto-mode-0
> > > 188 31% - clojure-ts-clojurescript-mode
> > > 164 27% - clojure-ts-mode
> > > 114 19% - treesit-major-mode-setup
> > > 114 19% - treesit-validate-font-lock-rules
> > > 91 15% treesit-query-compile
> > > 23 3% clojure-ts--ensure-grammars
> > > 10 1% + treesit-ready-p
> > > 1 0% + clojure-ts-mode-variables
> > > 24 4% + run-mode-hooks
> > > 1 0% + hack-dir-local--get-variables
> > > 6 1% + font-lock-mode
> > > 5 0% + run-hooks
> > > 2 0% insert-file-contents
> > > 1 0% abbreviate-file-name
> > > 1 0% + file-truename
> > > 1 0% + find-buffer-visiting
> > > 52 8% + project--read-file-name
> > > 4 0% + project-files
> > > 1 0% + execute-extended-command
> > > 122 20% - god-mode-lookup-key-sequence
> > > 85 14% - god-mode-lookup-command
> > > 85 14% - apply
> > > 85 14% - which-key--god-mode-lookup-command-advice
> > > 85 14% + #<native-comp-function god-mode-lookup-command>
> > > 37 6% + god-key-string-after-consuming-key
> > > 97 16% + byte-code
> > > 91 15% redisplay_internal (C function)
> > > 11 1% + ...
> > > 10 1% + timer-event-handler
> > > 1 0% + which-key--hide-popup
> >
> > Thanks, this seem to say that a large portion of time is spent inside
> > treesit-query-compile.
> >
> > > Also, I didn't original report this to the clojurescript-ts-mode folks because (1) since this branched into built-in functions it seemed like an emacs problem, and compoundingly (2) in one of the earlier iterations of my testing I was seeing this performance issue across all files that would load tree-sitter modes; however, I just did another couple tests and profiles with rust, bash, and TSX and didn't see it anymore, so I'll go poke them about it now because it does seem like more of their problem.
> >
> > It is quite possible that clojure-ts-clojurescript-mode defines some
> > mode-specific data that makes treesit-query-compile do some heavy
> > lifting. So I think you should report this to the mode developers.
[publickey - alexispurslane@pm.me - 0x41E61568.asc (application/pgp-keys, attachment)]
[signature.asc (application/pgp-signature, attachment)]
This bug report was last modified 10 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.