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
Move test for g:load_black to improve plugin performance #2896
Conversation
Actually, could you add a changelog entry in the "Integrations" section? |
CHANGES.md
Outdated
@@ -134,6 +134,7 @@ and the first release covered by our new | |||
|
|||
### Integrations | |||
|
|||
- Move test to disable plugin in vim/neovim, which speeds up loading (#2896) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the changelog for the already released 22.1.0, move your entry to the unreleased section at line 36
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry!
Thank you so much for your contribution! This project is only possible by contributions like these |
Description
If a vim/neovim user wishes to suppress loading the vim plugin by setting
g:load_black
in their VIMRC (for me, Arch linux automatically adds the plugin to Neovim's RTP, even though I'm not using it), the current location of the test comes after a call tohas('python3')
. This adds, in my tests, between 35 and 45 ms to Vim load time (which I know isn't a lot but it's also unnecessary). Moving the call toexists('g:load_black')
to before the call tohas('python3')
removes this unnecessary test and speeds up loading.Here is
nvim --startuptime
output for the plugin as written up to loading black.vim (note the 35ms load time due to sourcing python providers):Here's
nvim --startuptime
with my PR applied (note that the python provider is not loaded):Checklist - did you ...