mirror of
https://github.com/neovim/neovim.git
synced 2026-09-03 12:50:36 +00:00
Problem: The floating-point `.d` number match and the two ellipsis
matches are slow: each begins with a look-behind, which cannot
be reduced to a fixed first character, so the automatic regexp
engine selects the slower NFA backend for them.
Solution: Force the backtracking engine with \%#=1 on those three
patterns; it evaluates the look-behind far more efficiently.
Highlighting is unchanged.
Measured with :syntime over a 40000 line corpus: the three affected
rules drop from ~0.13s to ~0.008s (about -93%), which cuts the total
syntax parse cost by ~10% (1.85s to 1.65s).
closes: vim/vim#21194
e9c5e56081
Co-authored-by: Julien Voisin <julien.voisin@dustri.org>