-
Notifications
You must be signed in to change notification settings - Fork 299
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
Performance regression when opening Ansible YAML files #529
Comments
It loads immediately for me. Could you please attach load logs produced with:
|
Thanks for checking @sheerun! You're right, after disabling all plugins but vim-polyglot it starts immediately. Turns out it only occurs when vim-sleuth is enabled. I'm not sure whats wrong, but still, before creating this issue I checked without vim-polyglot and only ansible-vim and that worked. So I wonder what's the root of this (vim-sleuth or vim-polyglot). Maybe they just don't play well together :) Anyway I attache the startup log with only vim-polyglot and vim-sleuth enabled: Edit: formatting, typo |
vim-sleuth is really slow so it's not in my plugins as well. I guess it's because new setup doesn't setup shiftwidth and expandtab manually so sleuth tries to detect it which is really slow. I'll check this, but I suggest you just remove sleuth |
The weird thing is that I the performance only drops, if both plugins are enabled. If I disable vim-polyglot, vim-sleuth doesn't cause such performance issues. I can also reproduce the same behavior with a vim-sleuth may be a bit slow, but still is really helpful in projects without Editorconfig or similar 😉 Maybe I find some time soon to debug it and get more details. |
It seems to be because a) surprisingly vim-sleuth is able to detect only 8-characters-long soft tabs which is why it fails to detect softtabs for yaml file which has no lines indented with less than 8 spaces I think the best solution is to embed optimized version of sleuth in vim-polyglot |
Thank @sheerun! I didn't expect this and I really appreciate it! As far as I can tell, it works like a charm 😄 |
First, thanks for vim-polyglot! 😄
Does this bug happen when you install plugin without vim-polyglot? No
Describe the bug:
With the latest ftdetect changes/refactoring, Ansible (YAML) files take too long to open (~5s on my machine, but without measuring it precisely). Maybe related: #518
To Reproduce:
Open a YAML file in an Ansible project. I don't have a public repo, but used Arch Linux infra repo to reproduce:
git clone https://gitlab.archlinux.org/archlinux/infrastructure.git && cd infrastructure
nvim roles/common/tasks/main.yml
The text was updated successfully, but these errors were encountered: