Skip to content
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

perf: use faster 0.11 vim.validate #868

Merged
merged 3 commits into from
Jan 3, 2025
Merged

Conversation

iguanacucumber
Copy link
Contributor

this PR replaces vim.validate with it's new 0.11 implementation, that is ~36 000% faster, so it's as fast as no doing no validation at all ( nvim core PR )
This PR takes codes from an indent-blankline PR
Do not merge this right now, since this is only for 0.11

@iguanacucumber iguanacucumber marked this pull request as draft January 3, 2025 14:06
@antonk52
Copy link

antonk52 commented Jan 3, 2025

If the validate function signature is the same, why not introduce a backward compatible util function that can work for both older nvim version and nvim 0.11 and newer? Something along the lines of

utils.validate = vim.fn.has('nvim-0.11') == 1 and fastValidate or vim.validate

this will allow to use the same function across the codebase. Once nvim 0.10 support is dropped this util will no longer be needed

@iguanacucumber
Copy link
Contributor Author

From the author in PR 487:

I'll wait for 0.11 to release before merging, since I'd rather not maintain two different code paths for keymaps

@Saghen Saghen marked this pull request as ready for review January 3, 2025 16:05
@Saghen
Copy link
Owner

Saghen commented Jan 3, 2025

~0.16ms shaved off 😎

@Saghen Saghen merged commit a8957ba into Saghen:main Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants