New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: update impatient #2477
Conversation
5e56963
to
3f884ca
Compare
3f884ca
to
1154817
Compare
tested with a fuck ton of plugins
|
Are the cache files growing in size with this PR? I noticed that it might be more gradual with this new upstream implemention. |
I'll try it a bit more and report back |
i'm on mac and this is my nvim version
update: here are the results for cache size
startuptime
|
thanks for all the effort doing all those tests! so far the results seem to indicate a 10% loss in "reported" startup time, but we still get a better profiler, some other neat tricks with overloading btw, have you made some script to automate this? otherwise I can try to adapt this one https://github.com/echasnovski/mini.nvim/tree/main/benchmarks/starter |
🤞
no it was a manual process 😅 |
Here are my results with my daily config, using hyperfine with 50 rounds
the lv2#!/usr/bin/env bash
export LUNARVIM_RUNTIME_DIR="/tmp/lv2/lunarvim"
export LUNARVIM_CONFIG_DIR="/tmp/lv2/config"
export LUNARVIM_CACHE_DIR="/tmp/lv2/cache"
export LUNARVIM_BASE_DIR="$LUNARVIM_RUNTIME_DIR/lvim"
# function install() {
# local url="https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh"
# export LV_REMOTE="kylo252/lunarvim.git"
# export LV_BRANCH="upstream-impatient"
# bash <(curl -s "$url")
# # NOTE: remember to use the same config
# }
# install
function lvim() {
nvim -u "$LUNARVIM_BASE_DIR/init.lua" "$@"
}
lvim "$@" the diff --git a/lua/lvim/bootstrap.lua b/lua/lvim/bootstrap.lua
index d409e73..d0608f6 100644
--- a/lua/lvim/bootstrap.lua
+++ b/lua/lvim/bootstrap.lua
@@ -93,7 +93,7 @@ function M:init(base_dir)
end
-- FIXME: currently unreliable in unit-tests
- if not in_headless then
+ if not in_headless and not os.getenv "DISABLE_IMPATIENT" then
_G.PLENARY_DEBUG = false
require("lvim.impatient").setup {
chunks = { path = join_paths(get_cache_dir(), "lvim_luacache_chunks") },
benchmark.sh#!/usr/bin/env bash
set -eo pipefail
results_dir="nv-benchmarks"
# Number of rounds to perform benchmark
n_rounds=50
# Path to output .csv file with startup times per round
csv_file="startup-times.csv"
# Path to output file with summary table
summary_json="startup-summary.json"
summary_file="startup-summary.md"
tmp_bench_file="$(mktemp)"
nvim_bins="lvim,lv2,nvim"
function benchmark {
rm -rf "$results_dir"
mkdir -p "$results_dir"
pushd "$results_dir"
local after="tail -n 1 $tmp_bench_file | cut -d ' ' -f1 >> $csv_file"
local cmd="{nvim_bin} +'lua vim.schedule(function() vim.cmd [[qall]] end)' --startuptime $tmp_bench_file && $after"
local setup="rm -f $csv_file && echo {nvim_bin} > $csv_file"
# shellcheck disable=2155
local cleanup="mv $csv_file {nvim_bin}_$csv_file"
hyperfine --runs "$n_rounds" \
--setup "$setup" \
--export-json "$summary_json" \
--export-markdown "$summary_file" \
--cleanup "$cleanup" \
--warmup 3 \
--command-name "{nvim_bin}" \
--parameter-list nvim_bin "$nvim_bins" "$cmd"
popd
}
benchmark |
@abzcoding, here are more tests using your own config on an M1 machine the lv2#!/usr/bin/env bash
export LUNARVIM_RUNTIME_DIR="/tmp/lv3/lunarvim"
export LUNARVIM_CONFIG_DIR="/tmp/lv3/config"
export LUNARVIM_CACHE_DIR="/tmp/lv3/cache"
export LUNARVIM_BASE_DIR="$LUNARVIM_RUNTIME_DIR/lvim"
function install() {
local
url="https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh"
export LV_REMOTE="kylo252/lunarvim.git"
export LV_BRANCH="impatient-v3"
bash <(curl -s "$url")
# NOTE: remember to use the same config
rm -rf $LUNARVIM_CONFIG_DIR
gh repo clone abzcoding/lvim $LUNARVIM_CONFIG_DIR
mkdir -p $LUNARVIM_CACHE_DIR
}
# install
function lvim() {
nvim -u "$LUNARVIM_BASE_DIR/init.lua" "$@"
}
lvim "$@" |
fantastic, let's merge the third implementation then 👍 |
should I move the |
let's keep it in the same PR, it is gonna be one big PR, but at least all changes related to impatient would be in the same place |
I think the CI errors are related to how tmp files are handled on macos, could you try the branch and run the tests locally? |
It's because it's now using an independent |
this env var is not available on mac machines |
we should probably do that, since the language server binaries are exactly the same for nvim and lvim |
446065c
to
3ec000d
Compare
3ec000d
to
978820b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
* upstream/rolling: (48 commits) refactor: lock new installations to nvim v0.7+ (LunarVim#2526) fix(readme): remove black as linter (LunarVim#2510) fix(nvimtree): make sure on_config_done is using the correct require (LunarVim#2509) feat(installer): ensure correct responses when prompting user (LunarVim#2506) feat(peek): make sure max width and height are customizable (LunarVim#2492) chore: bump plugins version (LunarVim#2459) fix(nvimtree): escape the dot character in custom filter (LunarVim#2493) refactor: update impatient (LunarVim#2477) feat: lock nvim <0.7 to a specific tag (LunarVim#2491) fix(luasnip): only use user snippets if the folder exists (LunarVim#2481) fix(lualine): color theme gaps in some components (LunarVim#2465) fix(cmp): bring back default keybindings (LunarVim#2470) fix(cmp): update nvim-cmp to the latest version (LunarVim#2467) fix(readme): update lsp server ignore syntax refactor(lsp): cleanup servers' override configuration (LunarVim#2243) feat(cmp): documentation is deprecated in favor of window.documentation (LunarVim#2461) docs(windows): use alpha in config_win.example.lua (LunarVim#2452) chore: bump plugins version (LunarVim#2448) fix(impatient): avoid get_options in fast handler (LunarVim#2451) fix(luasnip): make sure all snippets are loaded (LunarVim#2447) ...
* upstream/master: (63 commits) chore: update changelog refactor: lock new installations to nvim v0.7+ (LunarVim#2526) fix(readme): remove black as linter (LunarVim#2510) fix(nvimtree): make sure on_config_done is using the correct require (LunarVim#2509) feat(installer): ensure correct responses when prompting user (LunarVim#2506) feat(peek): make sure max width and height are customizable (LunarVim#2492) chore: bump plugins version (LunarVim#2459) fix(nvimtree): escape the dot character in custom filter (LunarVim#2493) chore: update changelog refactor: update impatient (LunarVim#2477) feat: lock nvim <0.7 to a specific tag (LunarVim#2491) fix(luasnip): only use user snippets if the folder exists (LunarVim#2481) fix(lualine): color theme gaps in some components (LunarVim#2465) fix(cmp): update nvim-cmp to the latest version (LunarVim#2467) (LunarVim#2469) fix(cmp): bring back default keybindings (LunarVim#2470) fix(cmp): hotfix nvim-cmp version fix(cmp): update nvim-cmp to the latest version (LunarVim#2467) chore: update changelog fix(readme): update lsp server ignore syntax refactor(lsp): cleanup servers' override configuration (LunarVim#2243) ...
Description
vim.fn.stdpath
to use LUNARVIM_x_DIR instead, since a lot of plugins call this function interallyresolves #1256
fixes #2490
How to test
vim.fn.stdpath
:LunarVim/tests/specs/bootstrap_spec.lua
Lines 13 to 22 in 211fa20
Notes
For future references:
vim.fn.stdpath
, by either removing some entries from https://github.com/kylo252/LunarVim/blob/978820b8edc56a12fd0c34664d6adabbe4e51734/lua/lvim/bootstrap.lua#L73-L83, or overriding the function, yet again, inconfig.lua