diff options
author | Lewis Russell <lewis6991@gmail.com> | 2023-07-13 10:17:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-13 10:17:19 +0100 |
commit | 516b173780e39de3ce1e4525f0a8f0ff250c992b (patch) | |
tree | afd6b0148b9a02e1e33859aa437b9348024ec5a3 /src/nvim/ex_cmds2.c | |
parent | 998bebc15e9de70b3daaaa5900e974dea5abda3e (diff) | |
download | rneovim-516b173780e39de3ce1e4525f0a8f0ff250c992b.tar.gz rneovim-516b173780e39de3ce1e4525f0a8f0ff250c992b.tar.bz2 rneovim-516b173780e39de3ce1e4525f0a8f0ff250c992b.zip |
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.
Diffstat (limited to 'src/nvim/ex_cmds2.c')
-rw-r--r-- | src/nvim/ex_cmds2.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 40259767ff..b37076c62e 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -729,13 +729,9 @@ void ex_compiler(exarg_T *eap) do_unlet(S_LEN("g:current_compiler"), true); do_unlet(S_LEN("b:current_compiler"), true); - snprintf(buf, bufsize, "compiler/%s.vim", eap->arg); - if (source_runtime(buf, DIP_ALL) == FAIL) { - // Try lua compiler - snprintf(buf, bufsize, "compiler/%s.lua", eap->arg); - if (source_runtime(buf, DIP_ALL) == FAIL) { - semsg(_(e_compiler_not_supported_str), eap->arg); - } + snprintf(buf, bufsize, "compiler/%s.*", eap->arg); + if (source_runtime_vim_lua(buf, DIP_ALL) == FAIL) { + semsg(_(e_compiler_not_supported_str), eap->arg); } xfree(buf); |