Closed ModProg closed 1 year ago
My guess is due to the syntax used, it is shelling out to bash to perform the glob. You're probably better off just calling nvim_get_runtime
several times.
My guess is due to the syntax used, it is shelling out to bash to perform the glob. You're probably better off just calling
nvim_get_runtime
several times.
Makes sense, it's what I opted to do for now as well
Fixed by #24296
Neovim version (nvim -v)
v0.8.0-dev+207-g0adc66171
Vim (not Nvim) behaves the same?
no, lua :)
Operating system/version
Arch Linux
Terminal name/version
wezterm 20220528-212940-84842aaa
$TERM environment variable
xterm-256color
Installation
AUR
How to reproduce the issue
Compare how long
and
take
Expected behavior
Both should perform similarly fast.
Actual behavior
With the braces it takes a lot longer, even though it should be doing the same amount of work roughly.
And the difference is a lot bigger when measuring the functions directly:
I made a small test plugin, and it shows a difference of about a factor of 150 (times in µs):
The plugin is writen in rust with my own bindings, but someone knowledgeable in Lua should be able to write an easier to run test there as well: https://github.com/ModProg/nvim-perf-runtime_file/blob/c84070386220cfc43ce300acdd66fa0b3f05690f/src/lib.rs#L12-L28