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
plugin: optimize OS detection logic for Neovim. #88
plugin: optimize OS detection logic for Neovim. #88
Conversation
I'm not liking the resulting code here, since it increases the surface area needed to test changes. How about skipping the OS checks altogether, and just testing if each of "libparinfer_rust.so", "libparinfer_rust.dylib", and "parinfer_rust.dll" can be loaded, in sequence, with |
Yes, it currently is an absolute mess of conditionals. How would |
Actually, I guess it would perform the same in theory. :( Ok, how about moving the conditionals into a function and calling that function just before the existing |
That seems like a fine idea. |
Do you mean moving the current |
I like the latter better also, but would accept the first also. |
d547a49
to
f2fe726
Compare
I ended up going with the first one because the help text for In addition, I wasn't sure how to make it so that we do one trial |
We could also look at this for a somewhat simpler solution: https://vimways.org/2018/make-your-setup-truly-cross-platform/ |
I think the changes look good. Thanks! I queued the article for later reading. |
OS detection in Vim requires using the system command "uname", which is
very slow. This is not required in Neovim. Adding a specific case for
Neovim improves startup times by up to 15 ms.
Before the change: https://0x0.st/iIQU.txt
After the change: https://0x0.st/iIQl.txt
Notice the large difference in total time and that nearly all of the change was in the single
system('uname')
command