mhinz / vim-grepper

:space_invader: Helps you win at grep.
MIT License
1.22k stars 58 forks source link

`executable` seems to be really slow on arm64 macOS causing grepper #243

Closed lanza closed 3 years ago

lanza commented 3 years ago
for s:tool in g:grepper.tools
  if !has_key(g:grepper, s:tool)
        \ || !has_key(g:grepper[s:tool], 'grepprg')
        \ || !executable(expand(matchstr(g:grepper[s:tool].grepprg, '^[^ ]*')))
    call remove(g:grepper.tools, index(g:grepper.tools, s:tool))
  endif
endfor

This chunk of code is very slow on macOS arm64 neovim 0.5 as found by using vim's profiling setup. I'm guessing it has something to do with looking up different versions via rosetta. But at any rate it takes 3-4x as long as neovim with an empty init.vim just to load grepper.

Moving much of the code to autoload and lazy loading it would probably still be useful for even non-arm64-macOS.