[vim/vim] runtime(python): improve performance of number and ellipsis matching (PR #21194)

9 views
Skip to first unread message

Julien Voisin

unread,
Aug 30, 2026, 6:38:24 PM (3 days ago) Aug 30
to vim/vim, Subscribed

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


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/21194

Commit Summary

  • 97f33a6 runtime(python): improve performance of number and ellipsis matching

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21194@github.com>

Christian Brabandt

unread,
Sep 1, 2026, 2:54:48 PM (yesterday) Sep 1
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#21194)

thanks, nice


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21194/c5498830142@github.com>

Reply all
Reply to author
Forward
0 new messages