X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C5D883858C27
Authentication-Results: sourceware.org;
 dmarc=none (p=none dis=none) header.from=spocom.com
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=spocom.com
DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; d=spocom.com; s=mail;
 h=received:date:from:to:subject:message-id:mail-followup-to
 :references:mime-version:content-type:content-disposition
 :in-reply-to:x-operating-system:user-agent;
 b=gF5Ft9fIQx3dRrEO1um66Bq/LSR2aKHp9ky4iQxuIJ3PSO0x01niCkR9rpluRqFBl
 7Jk0NCk8XlB3GfTPmnRhg==
Date: Fri, 11 Mar 2022 16:22:18 -0800
From: Gary Johnson <garyjohn@spocom.com>
To: cygwin@cygwin.com
Subject: Re: Bash runs my vim slower than Cygwin's vim
Message-ID: <20220312002218.GD10070@phoenix>
Mail-Followup-To: cygwin@cygwin.com
References: <20220311005540.GB5869@phoenix>
 <20220311090306.mei46daorlpgorym@lucy.dinwoodie.org>
 <20220311173910.GB10070@phoenix> <20220311204339.GC10070@phoenix>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20220311204339.GC10070@phoenix>
X-Operating-System: Linux 2.6.32-74-generic GNU/Linux
User-Agent: Mutt/1.5.20 (2009-06-14)
X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, SPF_HELO_NONE, SPF_PASS, TXREP,
 T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>

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.

Regards,
Gary


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
