elisp-tree-sitter icon indicating copy to clipboard operation
elisp-tree-sitter copied to clipboard

Impact on typing and movement latency

Open skrat opened this issue 3 years ago • 7 comments

After enabling tree-sitter-hl-mode, the latency of typing and cursor movement is taking a big noticable hit. My impression before installing emacs-tree-sitter was that the latency is acutally going down. That turned out to be false. I don't have the numbers, but I'm quite sure anyone using emacs-tree-sitter must have noticed, unless my configuration is somehow special, which I don't think it is, just doom emacs, pretty fast otherwise. I'm using an older machine so people on fast systems perhaps don't notice it. I'm happy to provide any numbers or proofs.

skrat avatar Mar 19 '21 17:03 skrat

Enable tree-sitter also make things a bit more sluggish for me, very noticeable when using good-scroll.el for pixel smooth scrolling. Clearly a lot less smooth with tree-sitter enabled because less frames are able to be rendered,

snippins avatar Mar 19 '21 19:03 snippins

I haven't noticed any slowdowns but that may have to do with my configuration or just my denseness :)

sogaiu avatar Mar 19 '21 22:03 sogaiu

anyone using emacs-tree-sitter must have noticed, unless my configuration is somehow special, which I don't think it is, just doom emacs

Most Emacs configurations are special. "Just Doom Emacs" is already a lot of code.

Please provide more concrete details, otherwise this is non-actionable.

For example:

  • Version of tree-sitter, tree-sitter-langs.
  • Major and minor modes involved.
  • Minimal config to reproduce the issue.
  • Steps to trigger the behavior.
  • Measurements to quantify the issue.
  • Emacs build information.

ubolonton avatar Mar 20 '21 10:03 ubolonton

unless my configuration is somehow special, which I don't think it is, just doom emacs, pretty fast otherwise.

I use Doom Emacs as the basis of my Emacs configuration and I don't experience slowdowns or anything like that

shackra avatar Mar 20 '21 14:03 shackra

Experiencing the same as well (using DOOM Emacs). It becomes noticeable when running emacs on an external 4K monitor (and more so when emacs is splashed out across multiple 4K monitors with exwm) - toggling (global-tree-sitter-mode) and you instantly notice less movement/typing latency when it's off and native syntax highlighting is used (although I'd much prefer the highlighting that treesitter provides). My use case is Python 95%, running on emacs 28.0.50 native comp (non-pgtk).

matteha avatar May 27 '21 13:05 matteha

I'd love to help debug this but since I upgraded my HW I no longer experience this issue.

skrat avatar May 28 '21 19:05 skrat

Another potential cause is Emacs's general sluggishness when a buffer is displayed in multiple windows, which may somehow get even worse when tree-sitter is involved.

ubolonton avatar Jul 24 '21 11:07 ubolonton