mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-19 04:46:45 +00:00
perf: new file-based cache that ensures rtp is alweays correct and will cache all files, including those after startup
This commit is contained in:
parent
0d3f2c4042
commit
e115f5ec17
8 changed files with 275 additions and 513 deletions
|
@ -680,25 +680,6 @@ function M:debug()
|
|||
{ "not found", Cache.stats.find.not_found, "Number" },
|
||||
}, { indent = 2 })
|
||||
self:nl()
|
||||
|
||||
self:append("Cache.autoload()", "LazyH2"):nl()
|
||||
self:props({
|
||||
{ "total", Cache.stats.autoload.total, "Number" },
|
||||
{ "time", self:ms(Cache.stats.autoload.time, 3), "Bold" },
|
||||
{ "avg time", self:ms(Cache.stats.autoload.time / Cache.stats.autoload.total, 3), "Bold" },
|
||||
}, { indent = 2 })
|
||||
self:nl()
|
||||
|
||||
self:append("Cache", "LazyH2"):nl()
|
||||
local Cache = require("lazy.core.cache")
|
||||
Util.foreach(Cache.cache, function(modname, entry)
|
||||
local kb = math.floor(#entry.chunk / 10.24) / 100
|
||||
self:append("● ", "LazySpecial", { indent = 2 }):append(modname):append(" " .. kb .. "Kb", "Bold")
|
||||
if entry.modpath ~= modname then
|
||||
self:append(" " .. vim.fn.fnamemodify(entry.modpath, ":p:~:."), "LazyComment")
|
||||
end
|
||||
self:nl()
|
||||
end)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue