Re: Improving startup time for autocommands

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Improving startup time for autocommands

Manas Gupta
Hi everyone, I am facing some delay in startup time and doing
`--startuptime`, I can see that autocommands are the reason for the
delay. Specifically those autocmds where I am using BufEnter etc. type
events. I have quite a number of autocmds for various FileType(s)
and various events.

Can I get some suggestions on how to improve upon these or whether
I should switch autocmds with something else to improve upon
startuptime?

Thank you
--
Manas
CSAM Undergraduate | 2022
IIIT-Delhi, India

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20210213104944.oddlcif6nrbypqa7%40nitro-5.
Reply | Threaded
Open this post in threaded view
|

Re: Improving startup time for autocommands

Paul-7
On Sat, Feb 13, 2021 at 04:19:44PM +0530, Manas wrote:
>Hi everyone, I am facing some delay in startup time and doing
>`--startuptime`, I can see that autocommands are the reason for the
>delay. Specifically those autocmds where I am using BufEnter etc. type
>events. I have quite a number of autocmds for various FileType(s)
>and various events.
>
>Can I get some suggestions on how to improve upon these or whether
>I should switch autocmds with something else to improve upon
>startuptime?

See if you can use the FileType event instead of BufEnter.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20210213113317.GA25509%40rainslide.net.

signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Improving startup time for autocommands

Gary Johnson-4
In reply to this post by Manas Gupta
On 2021-02-13, Manas wrote:
> Hi everyone, I am facing some delay in startup time and doing
> `--startuptime`, I can see that autocommands are the reason for the
> delay. Specifically those autocmds where I am using BufEnter etc. type
> events. I have quite a number of autocmds for various FileType(s)
> and various events.
>
> Can I get some suggestions on how to improve upon these or whether
> I should switch autocmds with something else to improve upon
> startuptime?

When I run vim with --startuptime, I see only two autocommand
events, "BufEnter autocommands" and "VimEnter autocommands", and
they each consume only a few milliseconds.

If you are seeing significantly longer times than these, I would
suspect one or two of your autocommands are taking an
extraordinarily long time to run.  Since --startuptime doesn't
resolve individual autocommands, and since -V doesn't include times,
your best bet for finding the problem may be some sort of binary
search for the offending autocommand(s).  That is, comment-out half
of your autocommands, check --startuptime times again, see how much
they improved, then comment-out or un-comment-out half of the
appropriate set and repeat.

Once you find the one(s) taking a long time, you can post them here
for some advice on improving those times.

Regards,
Gary

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20210213215148.GD16915%40phoenix.