-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: noice command prompt slow on network storage #694
Comments
I thought it might be treesitter related. Treesitter trying to find noice syntax for highlighting of the command line. But I tried removing the treesitter plugin and it still searches for the syntax files on every key press. |
If I run nvim with the following commands the Noice command line is fast:
So it's the standard nvim filetype detection and syntax features that trigger on every key press in the Noice windows. I wonder if there is a way to disable that behaviour. |
So for every key press, M.tag from lua/noice/util/init.lua gets called, and if the filetype of the current buffer is empty it sets it to "noice" which causes neovim to search for ftplugin, syntax, indent, etc definitions for the non-existant "noice" language. This is pretty standard practice which is done by lots of plugins, but in this case it is really noticable because it gets called on every single key press and when you're nvim configuration is on network storage it causes quite a delay/lag. |
That commit should fix it. Do let me know if that wouldn't be the case. Thanks |
Super! Thanks! I just tested it with a clean nvim 0.9.5 and Lazyvim installation and it works perfectly now. Noice input is lag-free now even on network storage. Fix confirmed! |
Did you check docs and existing issues?
Neovim version (nvim -v)
0.9.5
Operating system/version
Debian GNU/Linux 12.4
Describe the bug
I noticed that the Noice command prompt is really slow in my environment. Every keypress in the command prompt feels very slugish. I first tried to exclude all the other plugins and then it was a little bit faster. Then I tried one by one to add plugins back, but there was not real one plugin that I could tie the slowness to. I also completely reinstalled nvim 0.9.5 with LazyVim without any other customizations, but that also resulted in a very slow command prompt.
I then used strace to see what nvim was doing when I was typing a command in the Noice command prompt. And then I saw that with every keypress it goes through all my .local/share/nvim subdirectories looking for files called noice.lua, noice.vim and subdirectories called "syntax/noice". This is about 90 statx calls and 56 access calls per key press in the command prompt which you don't really notice on local storage, but on a network filesystem like in my case NFS it is really noticable.
Strace output of a single key press in the Noice command prompt:
noice_commandprompt_keypress_strace_output.txt
This is quite a lot of filesystem calls especially when it happens on every single key press.
Steps To Reproduce
Expected Behavior
A fast responsive command prompt without lag.
The text was updated successfully, but these errors were encountered: