mirror of
https://github.com/neovim/neovim.git
synced 2025-12-10 00:22:41 +00:00
perf(loader): use a quicker version of vim.fs.normalize
Problem: vim.fs.normalize() normalizes too much vim.loader and is slow. Solution: Make it faster by doing less. This reduces the times spent in vim.fs.normalize in vim.loader from ~13ms -> 1-2ms. Numbers from a relative benchmark: - Skipping `vim.validate()`: 285ms -> 230ms - Skipping `path_resolve_dot()`: 285ms -> 60ms - Skipping `double_slash`: 60ms -> 35ms
This commit is contained in:
committed by
Lewis Russell
parent
87a45ad9b9
commit
dcdefd0428
@@ -85,7 +85,7 @@ function Loader.get_hash(path)
|
||||
end
|
||||
|
||||
local function normalize(path)
|
||||
return fs.normalize(path, { expand_env = false })
|
||||
return fs.normalize(path, { expand_env = false, _fast = true })
|
||||
end
|
||||
|
||||
--- Gets the rtp excluding after directories.
|
||||
|
||||
Reference in New Issue
Block a user