Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Tue, 3 Sep 2002 10:27:56 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: A Simple Real World Benchmark for cygwin
Message-ID: <20020903102756.V12899@cygbert.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <20020902155542.GC14051@redhat.com> <CHEDKHJJDLOCCOFLMGEAOEHMCLAA.dvasaru@broadpark.no> <20020902220234.GA22844@redhat.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20020902220234.GA22844@redhat.com>
User-Agent: Mutt/1.3.22.1i

On Mon, Sep 02, 2002 at 06:02:34PM -0400, Chris Faylor wrote:
> >Here's a potential speedup for non-NTFS symlinks:
> >
> >The check_shortcut function in shortcut.c calls CoInitialize/CoUninitialize
> >for *every* .LNK it needs to check on non EA filesystems.
> >
> >I ran a small test on my computer, calling check_shortcut 1000 times.
> >When I moved the calls to CoInitialze/CoUnitialize outside the
> >check_shortcut function, the function throughput increased from 59 calls/sec
> >to 960 calls/sec.
> >
> >As it turns out, CoInit...CoUninit costs up to 20 msecs on my system.
> >
> >So my suggestion is that the CoInit../CoUnit... calls be moved to another
> >spot, to be called once per thread.
> >
> >
> >Dan.
> >
> >PS. This patch made no difference what-so-ever on the timing results of the
> >cygbench configure on my NTFS disks; then again, it may help FATxx/Samba/NFS
> >people.

Uhm... it should have nothing to do with NTFS vs. other FS.  The shortcut
symlinks are used on all FS.

> Only if there are a lot of symlinks, it seems.  Otherwise the code would never
> be hit.  And indiscriminately setting it once for each thread could have some
> negative ramifications when the program isn't manipulating any symlinks.
> 
> It's a good suggestion, nonetheless.
> 
> Corinna, this is your code, what do you think?  Maybe a per-thread
> "initialized_yet?" global would be useful here.

The question is if we can drop CoUninitialize() completely.  If the call
to CoUninitialize() is dropped, it should not matter to call CoInitialize()
multiple times since it should only return a "The COM library is already
initialized on this thread" return code.  That shouldn't take that much
time.  The slowness results from the need to load DLLs and such stuff.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

