lewis6991 / impatient.nvim

Improve startup time for Neovim
MIT License
1.19k stars 28 forks source link

Reduce amount of total loaders #24

Closed lewis6991 closed 3 years ago

lewis6991 commented 3 years ago

... and completely replace vim._load_package

This speeds up statements like:

pcall(require, 'does.not.exist')

Since 'require' doesn't need to search through as many loaders and hence results in less calls to nvim_get_runtime_file().

Resolves #20

goolord commented 3 years ago

it's about a 2x speedup from HEAD impatient.nvim in this case, but still 2x slower than stock

goolord commented 3 years ago

a W is a W :+1:

lewis6991 commented 3 years ago

How exactly were you measuring the difference. I've added a test case that uses vim.loop.hrtime() before and after the require with a threshold of 1.2x. Did you do something similar? 2x still seems like a lot.

goolord commented 3 years ago

just calling a PackerProfile with the the misbehaving plugin mentioned in https://github.com/lewis6991/impatient.nvim/issues/20 and noting the difference in load time. i could use a lua profiling plugin but it seems adequate