-
Notifications
You must be signed in to change notification settings - Fork 206
Description
Background:
2d8a4e9 - This commit adds a new option named multiprocess
, best described from the commit message:
major performance improvement: process entries externally, READ BELOW:
Since LUA is single threaded I reached a limit to performance
optimization, both 'git_icons' and 'file_icons' require string
matching and manipulations which eventually hurt performance
when running on large amount of files.
In order to solve that this commit introduces the option to spawn
commands and process the entries in a separate neovim process which
prints to stdio as if it was a regular shell command. This speeds up
things significantly and also makes the UI super responsive as if fzf
was run in the shell. This required a few lua hacks to be able to load
nvim-web-devicons in a '--headless --clean' instance and sharing the
user configuration through the RPC interface from the running instance.
This is enabled by default for 'files' and 'grep' providers and can also
be enabled for 'git.files' if required, control using the 'multiprocess'
option.
Turns out I was a bit ballsy and there are still issues with it (e.g. #247).
Before I re-enable it again as default I'd like to have some testers use this (perferably on large codebases) and let me know the results.
It's only possible to enable it for files
, grep
and git_files
, either through setup:
require'fzf-lua'.setup {
files = {
multiprocess = true,
debug = false,
},
grep = {
multiprocess = true,
debug = false,
},
git = {
files = {
multiprocess = true,
debug = false,
},
}
}
Or by specifying it directly:
:lua require'fzf-lua'.files({ multiprocess = true })
-- or
:FzfLua files multiprocess=true
If debug=true
is specified the neovim shell command will be printed into the :messages
stream so you can run the command directly in the shell and see if everything seems right, the command wraps a shell command and prints the output to the shell after additonal processing, for example:
~ ❯ 'nvim' -n --headless --clean --cmd 'lua loadfile([[/home/bhagwan/.local/share/nvim/site/pack/packer/opt/fzf-lua/lua/fzf-lua/libuv.lua]])().spawn_stdio({debug=true,cmd=[[fd --color=never --type f --hidden --follow --exclude .git]],cwd=[[/home/bhagwan/.config/nvim/colors]],git_icons=false,file_icons=true,color_icons=true},[[_G._devicons_path='\''/home/bhagwan/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons/lua/nvim-web-devicons.lua'\''; return require("make_entry").file]],[[return require("make_entry").preprocess]])'
embark.vim
lua-embark.vim
lua-onedark.vim
The command above is then piped to fzf (as a separate process) increasing performance and freeing the neovim UI to do it's thing.
Testers, comments, issues all welcome in this thread.