diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2026-08-31 10:45:46 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2026-08-31 10:45:59 +0800 |
| commit | 7f7115f752997df048013ce94d81cb91d178f9e9 (patch) | |
| tree | f24108870563fc904be2b4a9b695a5da8faef209 /runtime/syntax/python.vim | |
| parent | b542f3a8f8689a9a033411456fb1c6576916c66b (diff) | |
| download | rneovim-7f7115f752997df048013ce94d81cb91d178f9e9.tar.gz rneovim-7f7115f752997df048013ce94d81cb91d178f9e9.tar.bz2 rneovim-7f7115f752997df048013ce94d81cb91d178f9e9.zip | |
vim-patch:560dfad: runtime(yaml): syntax highlighting of numbers is slow
Problem: YAML syntax highlighting is slow; the yamlInteger and yamlFloat
rules alone account for over half of the parsing time.
Solution: The number, null and timestamp scalar patterns begin with a
lookbehind, which stops the regexp engine from using a
first-character search, so the automatic engine selects the
much slower NFA engine. Force the backtracking engine with
\%#=1 on these patterns for a large speedup with identical
matches (Jordan).
On a 40000-line YAML file the total :syntime drops by about 30%: the
yamlFloat rule goes from 0.61s to 0.17s and yamlInteger from 0.42s to 0.31s.
The engine override is applied only to the lookbehind-anchored number rules;
forcing it on the structural plain-scalar and mapping-key patterns regresses
them badly, so those are left on the automatic engine.
closes: vim/vim#21182
https://github.com/vim/vim/commit/560dfadac8813ff040cf7d51cc44d4a73c92c701
Co-authored-by: Julien Voisin <julien.voisin@dustri.org>
Diffstat (limited to 'runtime/syntax/python.vim')
0 files changed, 0 insertions, 0 deletions