On Wed, May 24, 2017 at 11:08:58PM +0000, Antony Scriven wrote:
> On May 24, Frew Schmidt wrote:
> 
>  > [...]
>  >
>  > Maybe a dumb question, but why would BufNew be more expensive
>  > than BufRead?  Shouldn't the filetype stuff get run either way?
>  > I wouldn't expect BufRead to take 500ms and BufNew to take
>  > multiple seconds, would you?
> 
> The bufnew autocommands happen all at once. Change your autocommand
> to this instead:
> 
>     au bufnew *.md echo 'markdown bufnew'
>     au bufread *.md echo 'markdown bufread'
> 
> Then  :args *  and see what happens.
> 
> I think you should still remove the 'BufNew' from your autocommand
> (Christian's helpful-looking patch notwithstanding). I can't see
> what purpose it serves other than to detect name changes. If that's
> a real requirement, there's buffilepost. --Antony

Ok so the BufNew's happen at *allocation* time, where the BufRead's
happen when you actually pull up the buffer.  That makes sense.
Thanks, that explains a lot.

Yeah the BufNew was definitely cargo-cult and I'll remove it, but it
just seemed weird that it would cause this kind of slowdown.

-- 
fREW Schmidt
https://blog.afoolishmanifesto.com

-- 
-- 
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 vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to