-
Notifications
You must be signed in to change notification settings - Fork 10
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
How to reduce startup time besides using vim.loader.enable()
?
#125
Comments
@monkoose, not sure if you are still using hotpot, do you have a particularly large amount of complex macros? Looking at this line, we have to clear the in-memory versions of macros each time we build and can be expensive to code-gen. hotpot.nvim/fnl/hotpot/api/make.fnl Lines 83 to 90 in bedc290
|
I do use it, but I have converted it to use .hotpot.lua only and compile on demand, and compile into /lua directory and not use any cache files. It requires some workaround in init.lua, but after that it works like a charm, doesn't preload hotpot on neovim startup and compiles when any fennel file in my config was changed. And maybe it was some macro issue, because previously I have used compiler = {
macros = {
env = "_COMPILER",
compilerEnv = _G,
allowedGlobals = false,
},
}, But after I have realized that this is wrong approach and it messes up with other fennel compilers (from aniseed or fennel-ls) I have fixed it, but I have already switched to using hotpot only on demand, so can't be sure that it was the issue. My init.lua looks like this (there is workaround to make neovim work on first startup, when there are missing compiled files) vim.loader.enable()
local plugins_path = vim.fn.stdpath("data") .. "/lazy"
local config_path = vim.fn.stdpath("config")
-- Bootstrap lazy.nvim
local lazy_path = plugins_path .. "/lazy.nvim"
if not vim.loop.fs_stat(lazy_path) then
vim.notify("Fetching lazy.nvim...", vim.log.levels.INFO)
vim.fn.system({
"git",
"clone",
"--depth=1",
"--filter=blob:none",
"--single-branch",
-- "--branch=stable", -- latest stable release
"https://github.com/folke/lazy.nvim.git",
lazy_path,
})
end
vim.opt.runtimepath:prepend(lazy_path)
local ok, plugins = pcall(require, "plugins.lazy")
if not ok then
vim.print(plugins)
plugins = {
{
"rktjmp/hotpot.nvim",
dependencies = "monkoose/parsley",
config = function() require("hotpot.api.make").auto.build(config_path) end,
},
}
end
require("lazy").setup({
performance = {
rtp = {
disabled_plugins = {
"gzip",
"tarPlugin",
"zipPlugin",
"matchparen",
"tutor",
"matchit",
"tohtml",
"rplugin",
},
},
},
ui = { border = {'┏', '━', '┓', '┃', '┛', '━', '┗', '┃'} },
spec = plugins,
})
require("conf.options")
require("statusline")
require("conf.autocmds")
require("conf.maps")
.hotpot.lua return {
compiler = {
macros = {
env = "_COMPILER",
compilerEnv = _G,
},
},
build = {
{atomic = true},
{"fnl/**/*macros.fnl", false},
{"fnl/**/*.fnl", true},
{"colors/*.fnl", true},
{"after/**/*.fnl", true},
},
clean = {
{"lua/**/*.lua", true}
}
} |
Discussed in #116
Originally posted by s-cerevisiae September 3, 2023
v0.9.0 did fix the path separator problem on Windows. However during testing I found that the startup time (from v0.8 on) is ~2x slower than v0.7.0 and I think that's due to recent versions removing the byte code cache.
I added
vim.loader.enable()
to the first line of my bootstrapping lua file but that made little (~10ms) difference.This happens to me on both Linux and Windows machines so there might be something wrong with my config.
I'd like to know the currently recommended way to use
hotpot.nvim
withlazy.nvim
. Thank you in advance.My current (rather convoluted)
init.lua
withlazy.nvim
andhotpot.nvim
The text was updated successfully, but these errors were encountered: