mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
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:
@@ -527,12 +527,17 @@ ArrayOf(String) nvim_get_runtime_file(String name, Boolean all, Error *err)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static void find_runtime_cb(char *fname, void *cookie)
|
||||
static bool find_runtime_cb(int num_fnames, char **fnames, bool all, void *cookie)
|
||||
{
|
||||
Array *rv = (Array *)cookie;
|
||||
if (fname != NULL) {
|
||||
ADD(*rv, CSTR_TO_OBJ(fname));
|
||||
for (int i = 0; i < num_fnames; i++) {
|
||||
ADD(*rv, CSTR_TO_OBJ(fnames[i]));
|
||||
if (!all) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return num_fnames > 0;
|
||||
}
|
||||
|
||||
String nvim__get_lib_dir(void)
|
||||
|
Reference in New Issue
Block a user