perf(rtp): reduce rtp scans (#24191)

* perf(rtp): reduce rtp scans

Problem:
  Scanning the filesystem is expensive and particularly affects
  startuptime.

Solution:
  Reduce the amount of redundant directory scans by relying less on glob
  patterns and handle vim and lua sourcing lower down.
This commit is contained in:
Lewis Russell
2023-07-13 10:17:19 +01:00
committed by GitHub
parent 998bebc15e
commit 516b173780
13 changed files with 247 additions and 142 deletions

View File

@@ -118,12 +118,14 @@ describe('runtime:', function()
it('loads vim compilers when both lua and vim version exist', function()
local compiler_file = compiler_folder .. sep .. 'new_compiler'
write_file(compiler_file..'.vim', [[let b:compiler = 'vim']])
write_file(compiler_file..'.lua', [[vim.b.compiler = 'lua']])
exec('let b:compiler = "compiler"')
write_file(compiler_file..'.vim', [[let b:compiler = b:compiler.'_vim']])
write_file(compiler_file..'.lua', [[vim.b.compiler = vim.b.compiler..'_lua']])
exec('compiler new_compiler')
eq('vim', eval('b:compiler'))
-- lua version is sourced after vim
eq('compiler_vim_lua', eval('b:compiler'))
end)
end)