perf: new file-based cache that ensures correct rtp order (#532)

* perf: new file-based cache that ensures rtp is alweays correct and will cache all files, including those after startup

* refactor: new cache

* test: fix tests

* fix(cache): cache file names on Windows

* feat(cache): allow to disable the cache

* docs: updated cache settings
This commit is contained in:
Folke Lemaitre 2023-02-13 12:01:56 +01:00 committed by GitHub
parent 06f835d0b4
commit 462633bae1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 354 additions and 549 deletions

View file

@ -347,7 +347,7 @@ return {
init = " ",
import = " ",
keys = " ",
lazy = " ",
lazy = "󰒲 ",
loaded = "●",
not_loaded = "○",
plugin = " ",
@ -409,14 +409,6 @@ return {
performance = {
cache = {
enabled = true,
path = vim.fn.stdpath("cache") .. "/lazy/cache",
-- Once one of the following events triggers, caching will be disabled.
-- To cache all modules, set this to `{}`, but that is not recommended.
-- The default is to disable on:
-- * VimEnter: not useful to cache anything else beyond startup
-- * BufReadPre: this will be triggered early when opening a file from the command line directly
disable_events = { "UIEnter", "BufReadPre" },
ttl = 3600 * 24 * 5, -- keep unused modules for up to 5 days
},
reset_packpath = true, -- reset the package path to improve startup time
rtp = {