New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nvim-tree.git.utils has_cygpath executable check takes ~200ms #2459
Comments
Looking for cygpath is done by vim itself in various places e.g. https://github.com/neovim/neovim/blob/5d1c1da3c90adece96f491e7f12fd76c03a881c9/runtime/autoload/zip.vim although it looks to be lazy. I don't have access to or expertise with windows so I am flying blind here. Perhaps we can sort this out with feature flags. Please open and Please do the same for cygwin. Is that msys2? Also powershell please. |
Let's time the check directly. Please paste the following into local before = vim.loop.hrtime()
vim.fn.executable "cygpath"
local after = vim.loop.hrtime()
print(after - before .. "ns") On arch linux btrfs: |
When sourcing the has.lua under wsl, I get the following flags enabled: When installing neovim in powershell using the official .msi installer for windows of neovim version 0.91 and sourcing the file: Additionally, when running the check directly with the commands provided for I am admittedly unfamiliar with both cygwin and msys2 and don't have either of them set up currently. If you give me a 3-4 days I'll have a bit more free time to set them up and I can respond back here with the results running under both alternatives! |
This is a fantastic resource that will be invaluable in the future. I'd be eternally grateful for at least the cygwin one however don't feel pressured. With all of these we can definitively map feature flags and remove the unnecessary checks, or at least make them lazy. |
I've had pretty significant difficulties trying to get neovim installed within cygwin; the issues mostly revolve around some dependencies not being compatible with or available within cygwin. I was following the cygwin install directions and reading through some other discussions, but don't think I'll have the time to get it fully setup to run the I haven't actually tried installing via msys2, though. Please let me know if there's anything else I can do to help, or any other information that might be useful for you to have, especially pertaining to WSL2 installs. |
Many thanks for the feature flags @jtledon , it was very enlightening: https://github.com/nvim-tree/nvim-tree.lua/wiki/Development#os-feature-flags |
Wow... cygwin isn't looking good. Looking through issues I'm not seeing anything specific to cygwin or msys2 users. msys2 support, which appears to be the same as cygwin, was added via #1295 Looking at the discussion in #1290 it seems we didn't really have any knowledge. Options:
I'll go with 2 for now to get things going. |
@bstaint I'm reaching out to you as you are the only msys/cygwin user I know of. We are having some performance issues with windows users scanning their paths for cygpath.exe We need a definitive means of identifying cygwin without needing path scanning. I would be most grateful if you could collect feature flags for msys2 and cygwin as per #2459 (comment) Also... if you could explain the relationship/differences between msys and cygwin it would be most enlightening and allow us to properly support them in the future. |
@jtledon I'd be most grateful if you tested the 2. fix: cd /path/to/nvim-tree.lua
git pull
git checkout 2459-optional-cygwin-support |
@alex-courtis The fix seems to work perfectly on my end! (using a dev load of that branch with lazy.nvim). All normal functionalty seems to work for me as well. 2459-nvim-tree-cygwin-off-by-default.mp4Just for some additonal testing, I enabled the new Also, I just wanted to clarify from my previous statement, I'm by no means an expert on cygwin/msys2 and have never used either of them before. It's quite possible that all the install issues I was having could be easily resolved to get nvim working within them; I personally just wasn't having an easy time of it. That being said, I would be interested to hear more about them and the differences between them from someone who actually uses it. |
That's great, many thanks. All those conditionals are working as intended.
As would I. I last used cygwin the last time I used windows, 2006 or so. |
…e.git.cygwin_support to enable (#2486)
Description
nvim-tree takes roughly 200ms to start.
I have narrowed the issue down to a specific executable check in nvim-tree.git.utils, on line 5:
local has_cygpath = vim.fn.executable "cygpath" == 1
setup.git.enable = false does not resolve the issue
Im wondering if it has something to do with how long it takes to complete to complete external commands in WSL.
I would love to see an additional option that would allow me to disable this check, and default it to 0.
nvt-startuptime.mp4
Neovim version
Operating system and version
Windows 10 Vesion 22H2 OS Build 19045.3448 - WSL2 - Ubuntu 22.04.3 LTS
nvim-tree version
53b0bca
Clean room replication
Steps to reproduce
Opening neovim
Expected behavior
nvim-tree would have a minimal startup time
Actual behavior
nvim-tree has a significant startup time, far longer than anything else in my neovim config
The text was updated successfully, but these errors were encountered: