perf: split caching in state, cache and module

This commit is contained in:
Folke Lemaitre 2022-11-22 21:12:33 +01:00
parent a543134b8c
commit 54d5ff18f5
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
8 changed files with 455 additions and 395 deletions

View file

@ -1,7 +1,6 @@
local Config = require("lazy.config")
local Util = require("lazy.util")
local Loader = require("lazy.loader")
local Cache = require("lazy.cache")
local Module = require("lazy.core.module")
local M = {}
@ -77,7 +76,7 @@ function M.process_config(plugin)
local name = plugin.name
local modname = Config.options.plugins .. "." .. name
local spec = Cache.load(modname)
local spec = Module.load(modname)
if spec then
-- add to loaded modules
if spec.requires then
@ -130,7 +129,6 @@ function M.process()
plugin.dir = Config.options.package_path .. "/" .. (plugin.opt and "opt" or "start") .. "/" .. plugin.pack
plugin.installed = Util.file_exists(plugin.dir)
M.process_local(plugin)
Loader.add(plugin)
end
end