ayamir / nvimdots

A well configured and structured Neovim.
BSD 3-Clause "New" or "Revised" License
2.83k stars 451 forks source link

Made improvement for startup time. #1171

Closed Cyberczy closed 4 months ago

Cyberczy commented 4 months ago

Feature description

Before: image Now: image

I made the following changes.

require("core.options")
require("core.pack")
vim.api.nvim_create_autocmd("User", {
    pattern = "VeryLazy",
    callback = function()
        require("core.mapping")
        require("core.event")
        require("keymap")
    end,
})

I don't know if this affects the normal use of nvimdots, can you take a look?

Additional information

No response

Cyberczy commented 4 months ago

visible issues { "FileType", "alpha", "set showtabline=0" },don't work image

Cyberczy commented 4 months ago

visible issues { "FileType", "alpha", "set showtabline=0" },don't work image

fixed in alpha.lua

vim.api.nvim_create_autocmd("User", {
    pattern = "LazyVimStarted",
    callback = function()
        vim.o.showtabline = 0 -- this line
        dashboard.section.footer.val = footer()
        pcall(vim.cmd.AlphaRedraw)
    end,
})
Mythos-404 commented 4 months ago

On my wsl2(archlinux), windows, archlinux I can only get 1~2ms improvement after testing. This is really not necessary and can lead to some binding problems!

Cyberczy commented 4 months ago

Just a suggestion lol

Mythos-404 commented 4 months ago

Try using lua concatenation to improve performance. This is how my xmake.lua plugin went from 20ms->5ms

ayamir commented 4 months ago

Agree with @Mythos-404, this improvement is limited. And current implementation is more readable. IMO the startup time is not the main issue now because less than 30ms is a value that is acceptable to most of humans. Thanks for your efforts.