mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
perf: way better compilation and caching
This commit is contained in:
parent
c749404423
commit
a543134b8c
6 changed files with 390 additions and 133 deletions
|
@ -4,28 +4,42 @@ local M = {}
|
|||
function M.setup(opts)
|
||||
--FIXME: preload()
|
||||
|
||||
local Cache = require("lazy.cache")
|
||||
|
||||
local start = vim.loop.hrtime()
|
||||
Cache.boot()
|
||||
|
||||
local Util = require("lazy.util")
|
||||
local Config = require("lazy.config")
|
||||
local Plugin = require("lazy.plugin")
|
||||
|
||||
Util.track("lazy_boot", vim.loop.hrtime() - start)
|
||||
|
||||
Util.track("lazy_setup")
|
||||
|
||||
Util.track("lazy_config")
|
||||
Config.setup(opts)
|
||||
Util.track()
|
||||
|
||||
Util.track("plugin_normalize")
|
||||
Plugin.normalize(Config.options.plugins)
|
||||
if not Config.plugins.lazy then
|
||||
Plugin.plugin({
|
||||
"folke/lazy.nvim",
|
||||
opt = false,
|
||||
})
|
||||
end
|
||||
Util.track()
|
||||
Util.track("lazy_plugins")
|
||||
if not Cache.setup() then
|
||||
vim.schedule(function()
|
||||
vim.notify("Reloading")
|
||||
end)
|
||||
Util.track("plugin_normalize")
|
||||
Plugin.normalize(require(Config.options.plugins))
|
||||
if not Config.plugins.lazy then
|
||||
Plugin.plugin({
|
||||
"folke/lazy.nvim",
|
||||
opt = false,
|
||||
})
|
||||
end
|
||||
Util.track()
|
||||
|
||||
Util.track("plugin_process")
|
||||
Plugin.process()
|
||||
Util.track("plugin_process")
|
||||
Plugin.process()
|
||||
Util.track()
|
||||
end
|
||||
Util.track()
|
||||
|
||||
Util.track("lazy_install")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue