Bash runs my vim slower than Cygwin's vim
Sat Mar 12 00:22:18 GMT 2022
On 2022-03-11, Gary Johnson wrote:
> On 2022-03-11, Gary Johnson wrote:
> > On 2022-03-11, Adam Dinwoodie wrote:
> > > On Thu, Mar 10, 2022 at 04:55:40PM -0800, Gary Johnson wrote:
> > > > 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?
> > > - 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.
> Just a quick update: I stripped my version and the real time for my
> benchmark test dropped from 1.42 s to 0.40 s. Still not as low as
> Cygwin's vim (0.12 s), but a substantial improvement.
I installed cygport and built vim using Adam's command. It wanted
some libraries that I don't have installed, such as for X, which
I don't use on Windows, so I modified vim.cygport to not require
those. The result ran a little slower than /usr/bin/vim. So to
really understand this, I will probably have to install those
libraries and run vim.cygport unmodified.
However, by changing CFLAGS to remove -g3 and add -O2 for my own
build, and by stripping the binary, the startup time for vim to edit
a particular file dropped from 8 seconds to 2 seconds, and even
using /usr/bin/vim takes 1.4 seconds, so I'm happy for now.
Thanks, Adam, for the help.
More information about the Cygwin