neovim/runtime
Evgeni Chasnovski f61efe3fe7
perf(filetype): implement parent pattern pre-matching (#29660)
Problem: calling `vim.filetype.match()` has performance bottleneck in
  that it has to match a lot of Lua patterns against several versions of
  input file name. This might be the problem if users need to call it
  synchronously a lot of times.

Solution: add "parent pattern pre-matching" which can be used to quickly
  reject several potential pattern matches at (usually rare) cost of
  adding time for one extra Lua pattern match.

  "Parent pattern" is a manually added/tracked grouping of filetype
  patterns which should have two properties:
    - Match at least the same set of strings as its filetype patterns.
      But not too much more.
    - Be fast to match.

  For them to be effective, group should consist from at least three
  filetype patterns.

  Example: for a filetpye pattern ".*/etc/a2ps/.*%.cfg", both "/etc/"
  and "%.cfg" are good parent patterns (prefer the one which can group
  more filetype patterns).

  After this commit, `vim.filetype.match()` on most inputs runs ~3.4
  times faster (while some inputs may see less impact if they match
  many parent patterns).
2024-07-18 10:26:27 -05:00
..
autoload vim-patch:1cc4cae: runtime(typst): Add typst runtime files 2024-07-16 09:43:57 +02:00
colors
compiler vim-patch:1cc4cae: runtime(typst): Add typst runtime files 2024-07-16 09:43:57 +02:00
doc perf(filetype): implement parent pattern pre-matching (#29660) 2024-07-18 10:26:27 -05:00
ftplugin vim-patch:9.1.0593: filetype: Asymptote files are not recognized 2024-07-17 11:11:58 +02:00
indent vim-patch:1cc4cae: runtime(typst): Add typst runtime files 2024-07-16 09:43:57 +02:00
keymap
lua perf(filetype): implement parent pattern pre-matching (#29660) 2024-07-18 10:26:27 -05:00
macros
pack/dist/opt vim-patch:27f5334: runtime(termdebug): quote filename arguments using double quotes 2024-07-18 13:28:12 +08:00
plugin fix(tohtml): support ranges again 2024-07-16 15:07:40 +02:00
queries
spell
syntax vim-patch:1724ddb: runtime(sdc): update syntax to SDC-standard 2.1 2024-07-18 08:48:24 +02:00
tools
tutor
CMakeLists.txt
delmenu.vim
filetype.lua
ftoff.vim
ftplugin.vim
ftplugof.vim
indent.vim
indoff.vim
macmap.vim
makemenu.vim
menu.vim
mswin.vim
neovim.ico
nvim.appdata.xml
nvim.desktop
nvim.png
optwin.vim
synmenu.vim
windows_icon.rc