emacs-tree-sitter / elisp-tree-sitter

Emacs Lisp bindings for tree-sitter
https://emacs-tree-sitter.github.io
MIT License
816 stars 73 forks source link

Impact on typing and movement latency #133

Open skrat opened 3 years ago

skrat commented 3 years ago

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.

snippins commented 3 years ago

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,

sogaiu commented 3 years ago

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

ubolonton commented 3 years ago

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:

shackra commented 3 years ago

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

matteha commented 3 years ago

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).

skrat commented 3 years ago

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

ubolonton commented 2 years ago

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.