Bash runs my vim slower than Cygwin's vim

Gary Johnson garyjohn@spocom.com
Fri Mar 11 17:39:10 GMT 2022


On 2022-03-11, Adam Dinwoodie wrote:
> On Thu, Mar 10, 2022 at 04:55:40PM -0800, Gary Johnson wrote:
> > I build my own copy of Vim for the Cygwin terminal from the source
> > at https://github.com/vim/vim.git.  Lately, I've noticed the startup
> > time getting slower, so I investigated.  One of the things
> > I discovered was this difference between the run times of the
> > official Cygwin vim package and the vim I built myself.  Both are
> > version 8.2.4372 and built using the same configuration and compiler
> > flags except for some options such as Ruby that I don't have support
> > for on my system.
> > 
> > <snip>
> > 
> > So, does anyone know why is takes so much longer for bash to run the
> > vim I built than the official Cygwin vim?  More importantly, how do
> > I fix this?
> 
> There are a few differences that jump to mind between the Cygwin
> packaged Vim and your locally built Vim.  This isn't my area of
> expertise by a long shot, but my guess would be it's one of these:

Thanks for taking a look.

> - Cygwin packages built using Cygport and packaged for release will have
>   the binaries stripped, removing debug symbols and the like and
>   separating them into a different -debug package.  That means that the
>   binaries that are loaded for day-to-day use are smaller, and may well
>   mean they're faster too.

The Cygwin vim was built with -ggdb, but I didn't look for strip and
Cygwin's file doesn't report whether or not binaries are stripped--
it probably can't determine that.  I'll try stripping mine.

> - Binaries installed by Cygwin setup will get automatically added to
>   Cygwin's rebase database.  I don't think that would help here --
>   problems with rebase normally manifest as fork failures, not just
>   slowness -- but it's another difference that seemed like it might be
>   relevant.
> 
> - Cygwin's Vim has a handful of patches.  I've just had a quick look and
>   none of them seem obviously likely to make a significant perf
>   difference to me, but it was only a quick look and see above re lack
>   of expertise :)

I looked at those, too, and didn't see anything that I thought would
cause a performance issue, either.

> I suspect the best way to investigate this further will be to try to
> narrow down the possible differences between your build and the official
> Cygwin build.  To do that, I'd probably start with getting the source
> for the official Cygwin build, compiling it using Cygport (`cygport
> vim.cygport prep compile install package`), then "installing" it as if
> it were a regular Cygwin package (`tar -xaf vim-*/dist/vim/vim-*.tar.*
> -C /` is close enough for most purposes).

I thought about that, too, but didn't know how to do it and hadn't
waded into the cygport docs.  Thanks for the instructions.

If the problem is due to a difference in the way I built my version,
it appears from my strace of bash that it happens in the code that
precedes vim's main().  I don't know what that would be.  Perhaps it
does have something to do with preparing the program for debugging.

Regards,
Gary



More information about the Cygwin mailing list