www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/06/27/17:29:50

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Sun, 27 Jun 2004 17:29:50 -0400
From: "Pierre A. Humblet" <pierre DOT humblet AT ieee DOT org>
To: cygwin AT cygwin DOT com
Subject: Re: higher-level IO very slow with cygwin1.dll 5.10 (due to set_flags?)
Message-ID: <20040627212949.GA176017@Worldnet>
References: <opr96vbqwilh6y6a AT localhost> <20040626154504 DOT GA961349 AT hpn5170x> <20040626160554 DOT GA980221 AT hpn5170x> <20040626170940 DOT GD20063 AT trixie DOT casa DOT cgf DOT cx> <20040626174145 DOT GA1032441 AT hpn5170x> <20040627194205 DOT GA10371 AT trixie DOT casa DOT cgf DOT cx>
Mime-Version: 1.0
In-Reply-To: <20040627194205.GA10371@trixie.casa.cgf.cx>
User-Agent: Mutt/1.4.1i

On Sun, Jun 27, 2004 at 03:42:05PM -0400, Christopher Faylor wrote:
> On Sat, Jun 26, 2004 at 01:41:45PM -0400, Pierre A. Humblet wrote:

> >Digging deeper, I see there is a function getc_unlocked. Using it
> >instead of getc improves the speed by a factor 5. 
> >Now that I know about it, I will redefine getc to getc_unlocked when
> >porting single threaded applications.
> >
> >That issue may be a factor in the legendary slowness of Cygwin.
> 
> FWIW, I added some code to this particular locking function to avoid
> doing any locks if there is only one thread.  I'm generating a snapshot
> now.  It will be interesting to see if it improves things.  I didn't
> do any benchmarking.  I just verified that it worked the way I thought
> it should by looking at strace output.

Here it is, using a slightly modified version of Joseph's program
http://cygwin.com/ml/cygwin/2004-06/msg00877.html

Your change makes getc work almost as fast a getc_unlocked.
This is on Win98. Yesterday's results were on WinME, where the
differences were larger. That hard drive died this morning :(

CYGWIN_98-4.10 Worldnet 1.5.10(0.116/4/2) 2004-05-25 22:07 i586 unknown unknown Cygwin

W:~: time a.exe daqsystem.pdf 1  (read)
real    0m0.282s
W:~: time a.exe daqsystem.pdf 2  (getc_unlocked)
real    0m1.295s
W:~: time a.exe daqsystem.pdf 3  (getc)
real    0m3.188s

CYGWIN_98-4.10 Worldnet 1.5.11s(0.116/4/2) 20040627 15:47:35 i586 unknown unknown Cygwin

W:~: time a.exe daqsystem.pdf 1   (read)
real    0m0.275s
W:~: time a.exe daqsystem.pdf 2   (getc_unlocked)
real    0m1.294s
W:~: time a.exe daqsystem.pdf 3   (getc)
real    0m1.343s                 

Pierre

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019