[vim/vim] Avoid repeated case conversion in fuzzy matching (PR #21241)

5 views
Skip to first unread message

mattn

unread,
Sep 7, 2026, 2:09:48 AM (4 days ago) Sep 7
to vim/vim, Subscribed

Compute the uppercase search character once per character in has_match(), instead of repeating the conversion while scanning each candidate. This reduces work in fuzzy completion without changing matching or scoring.

Benchmark: five matchfuzzypos() calls per sample, median of seven paired trials with alternating before/after order, pinned to CPU 0. UTF-8, GCC -O2; before a96c3bc1f7, after 06ebf3020d. Path cases use 8,430 tracked files under src/ and runtime/; mixed cases prefix each path with 日本語/, and Unicode-case candidates append /École. Short cases use 5,000 copies of abc. Negative time changes mean faster execution.

Candidates Pattern Before (ms) After (ms) Time change
Paths zzzz 21.037 15.369 -26.9%
Paths cmd 47.668 38.968 -18.3%
Paths test vim 110.191 90.553 -17.8%
Japanese + paths 46.061 18.662 -59.5%
Japanese + paths 日cmd 60.188 50.384 -16.3%
Paths + /École éco 130.553 101.616 -22.2%
Short, exact match abc 22.159 22.359 +0.9%
Short, no match z 3.467 3.110 -10.3%

All result lists, match positions, and scores were identical before and after in every trial. Multibyte cases improved in this benchmark; the short exact-match case measured 0.9% slower.

Validation: build passed without warnings; all nine test_matchfuzzy tests and four Test_getcompletion* tests in test_cmdline passed.


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

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

Commit Summary

  • 06ebf30 Avoid repeated case conversion in fuzzy 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/21241@github.com>

Christian Brabandt

unread,
Sep 7, 2026, 4:05:19 PM (3 days ago) Sep 7
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#21241)

thanks


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/21241/c5575174037@github.com>

Reply all
Reply to author
Forward
0 new messages