mirror of https://github.com/folke/lazy.nvim.git
feat(profiling): merge VeryLazy stats and show startuptime in profile view
This commit is contained in:
parent
cea5920abb
commit
0f2786bcc9
|
@ -75,7 +75,9 @@ function M:_add(event)
|
||||||
end
|
end
|
||||||
-- HACK: work-around for https://github.com/neovim/neovim/issues/25526
|
-- HACK: work-around for https://github.com/neovim/neovim/issues/25526
|
||||||
done = true
|
done = true
|
||||||
|
if event.id ~= "VeryLazy" then
|
||||||
Util.track({ [self.type] = event.id })
|
Util.track({ [self.type] = event.id })
|
||||||
|
end
|
||||||
|
|
||||||
local state = M.get_state(ev.event, ev.buf, ev.data)
|
local state = M.get_state(ev.event, ev.buf, ev.data)
|
||||||
|
|
||||||
|
@ -86,7 +88,9 @@ function M:_add(event)
|
||||||
for _, s in ipairs(state) do
|
for _, s in ipairs(state) do
|
||||||
M.trigger(s)
|
M.trigger(s)
|
||||||
end
|
end
|
||||||
|
if event.id ~= "VeryLazy" then
|
||||||
Util.track()
|
Util.track()
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
|
@ -171,7 +171,9 @@ function M.very_lazy()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
vim.g.did_very_lazy = true
|
vim.g.did_very_lazy = true
|
||||||
|
M.track({ event = "VeryLazy" })
|
||||||
vim.api.nvim_exec_autocmds("User", { pattern = "VeryLazy", modeline = false })
|
vim.api.nvim_exec_autocmds("User", { pattern = "VeryLazy", modeline = false })
|
||||||
|
M.track()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ M.C = nil
|
||||||
|
|
||||||
function M.on_ui_enter()
|
function M.on_ui_enter()
|
||||||
M._stats.startuptime = M.track("UIEnter")
|
M._stats.startuptime = M.track("UIEnter")
|
||||||
|
require("lazy.core.util").track({ start = "startuptime" }, M._stats.startuptime * 1e6)
|
||||||
vim.api.nvim_exec_autocmds("User", { pattern = "LazyVimStarted", modeline = false })
|
vim.api.nvim_exec_autocmds("User", { pattern = "LazyVimStarted", modeline = false })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue