-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REPLCompletions spends a lot of time on statx
syscalls (when crawling filesystem)
#53153
Comments
I also noted in #52765 (using We should be able to scan once (or refresh on an interval) and then re-use the results for completion hints. |
@vtjnash is that something that libuv can handle? Could we add something like I wondered if the flags to |
Its here: https://docs.libuv.org/en/v1.x/fs.html#c.uv_fs_scandir_next
|
I'm referring to https://docs.libuv.org/en/v1.x/fs.html#c.uv_fs_scandir which seems to not have docs? Notably what the flags arg is. |
I think those two are meant to be used together: with
Indeed, can't find them either. |
Sorry, I wasn't clear, both are used by Lines 921 to 928 in 33d9e2a
|
Ok, now I see what you mean, sorry. Grep-ing |
The returned libuv uses |
Great point.
or
I'm leaning towards the latter because from some testing a symlink will return
which still avoids |
Alternatively
or special-case files which could do that under the hood
|
I think the file system limitation #53153 (comment) still applies, and so you might prepare to also handle I like |
Ah so check
|
No, I meant to use Also: I think the type can be any of the enums here https://github.com/libuv/libuv/blob/507f3046d104db2be2c33d5e8fc0d5322818a62c/include/uv.h#L1220. |
I wonder if we should have a version (
(The path and type fields would be computed values, instead of being actually stored in the struct.) |
It was observed in #52765 that we generate a lot of
statx
andreadlink
syscalls when scanning the filesystem.Especially on WSL systems this kind of access pattern can be very slow:
The example above is not contrived. WSL by default appends
/mnt/c/Windows/System32/
to my PATH so that when REPLCompletions walks the PATH, it has to do pretty much exactly the above.Thankfully the
getdents64
syscall on many modern Linux filesystems should allow getting file vs. directory information for lots of files in one go, so there should be a pathway to optimize this.The text was updated successfully, but these errors were encountered: