-
-
Notifications
You must be signed in to change notification settings - Fork 240
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: set appropiate/missing lazy loading events #856
Conversation
Review ChecklistDoes this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist: Proper conventional commit scoping:
|
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.
will it not get loaded when using the mappings?
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.
A few of these need to be reverted because they are significantly less performant. Other than that, thanks for the recommendations!
EDIT: realized lazy = true
is no longer default, so what most of these actually just need is lazy = true
since they are all lazy loaded based on module.
@@ -1,5 +1,6 @@ | |||
return { | |||
"Pocco81/true-zen.nvim", | |||
event = "VeryLazy", |
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.
event = "VeryLazy", | |
lazy = true, |
This should not be lazy loaded on event. It is lazy loaded on module and keybinding. We should make it lazy = true
.
@@ -1,4 +1,4 @@ | |||
return { | |||
"matze/vim-move", | |||
event = "BufEnter", | |||
event = "User AstroFile", |
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.
event = "User AstroFile", | |
event = { "User AstroFile", "InsertEnter" }, |
This lets it work on new files as well
@@ -1,6 +1,7 @@ | |||
return { | |||
{ | |||
"lvimuser/lsp-inlayhints.nvim", | |||
event = "User AstroLspSetup", |
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.
event = "User AstroLspSetup", | |
lazy = true, |
This lazy loading is handled by the autocmd and should not be loaded on event. This is less performant. It should just be lazy = true
.
event = "User AstroFile", | ||
ft = { "yaml", "json" }, |
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.
event = "User AstroFile", | |
ft = { "yaml", "json" }, | |
lazy = true, |
this should be reverted. This is more performant as is. It is lazy loaded based on module only when needed.
f6f140d
to
69b6797
Compare
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.
I went in and resolved the performance issues. Thanks!
📑 Description
Noticed some lazy loading improvements from my personal config. These were the one i am using, sorry but i cannot check all plugins, i hope i can improve the startup/running performance a tiny bit further.