neovim/runtime/lua
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
..
vim perf(filetype): implement parent pattern pre-matching (#29660) 2024-07-18 10:26:27 -05:00
_vim9script.lua refactor(lua): rename tbl_islist => islist 2024-04-21 17:08:07 +02:00
coxpcall.lua
editorconfig.lua feat(editorconfig): add support for spelling_language (#28638) 2024-06-06 09:16:43 -05:00
man.lua fix(man): filter OSC 8 hyperlink markup #29171 2024-06-07 12:43:17 -07:00
tohtml.lua fix(tohtml): support ranges again 2024-07-16 15:07:40 +02:00