-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
regexpengine=1 slow in RestructuredText Files #14716
Comments
What I would do here is start by reproducing the bug on master (you can compile from source by following the instructions here). Once you've confirmed that the bug still exists on master there are multiple paths:
|
Highlight_Matching_Pair()
freezes Neovim in RestructuredText Filesregexpengine=1
freezes Neovim in RestructuredText Files
A couple things. First, I made a mistake in my Second, I actually ran So I guess technically, this isn't a bug, since the old engine probably isn't getting some love. And with the default, Neovim runs fine. I changed the title of this bug report to point future users in the right direction. Future users: if you run into this problem, you probably have I am closing this report, but the maintainers are welcome to reopen it if they wish. |
We actually do care about regexp engine 1. But it's actually the skip expression (meaning evaluating the syntax stack) that is so expensive. I wondered about it, because the searchpairpos() call is called with a timeout value. But that is not the problem here. Evaluating the syntax stack takes so long. Check the output of It may also help to tune the Ping @brammool and @marshallward, because the rstExDirective syntax region might be tuned (e.g. by adding an atom to force the regexp-engine 2):
The FWIW, the output of
|
BTW: wondering if this:
couldn't easily be written as |
Okay. I will reopen this issue and investigate with |
I think the Most of his regions were terminated by a block without leading whitespace, which was never strictly correct and has been gradually relaxed throughout other regions, so I would think that it could be replaced with something less expensive. |
regexpengine=1
freezes Neovim in RestructuredText Files
nvim --version
:Operating system/version: Gentoo Linux
x86_64
, up to date.Terminal name/version:
kitty
0.20.3 runningtmux
3.1c$TERM
:screen-256color
[ ]
vim -u DEFAULTS
(version: 8.2) behaves differentlyvim
version info:Steps to reproduce using
nvim -u NORC
Actual behaviour
When opening the file that can be found at https://git.yzena.com/Yzena/Yc/src/branch/master/docs/yvm/design/main.rst, Neovim takes several seconds to render the file, eventually spitting out the message:
If you go down to the bottom of the file, just above the line:
on line 570, insert a new line, and type:
Neovim freezes when trying to type the
(
.When I profiled the problem with the procedure recommended here, and when using the reproducer with
nvim -u NORC
above, I got the following in myprofile.log
:which obviously shows
73_Highlight_Matching_Pair()
as the problem.When finding
Highlight_Matching_Pair()
inprofile.log
, I see this:So it appears that
searchpairpos()
may be the problem.In addition, editing RestructuredText files in Neovim just feels slow, and when profiling the slow editing, nothing really stands out.
Expected behaviour
Instant, or near instant, editing of RestructuredText files.
Other
I would love to help fix this, but I am not familiar enough with Neovim's code to help. If I can get some pointers, I can try to track it down further and fix it.
The text was updated successfully, but these errors were encountered: