Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Sat, 26 Jun 2004 12:05:54 -0400
From: "Pierre A. Humblet" <pierre.humblet@ieee.org>
To: cygwin@cygwin.com
Subject: Re: higher-level IO very slow with cygwin1.dll 5.10 (due to set_flags?)
Message-ID: <20040626160554.GA980221@hpn5170x>
Mail-Followup-To: "Pierre A. Humblet" <pierre.humblet@ieee.org>, cygwin@cygwin.com
References: <opr96vbqwilh6y6a@localhost> <20040626154504.GA961349@hpn5170x>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20040626154504.GA961349@hpn5170x>
User-Agent: Mutt/1.4.1i

On Sat, Jun 26, 2004 at 11:45:04AM -0400, Pierre A. Humblet wrote:
> On Sat, Jun 26, 2004 at 02:36:52AM -0400, Joseph wrote:
> > Thanks to those who responded to my post.
> > 
> > I am not sure though if all of you read the
> > entire sequence of the thread.
> > 
> > In my first post, I did attach an excerpt
> > from an strace dump of a sample program that
> > seemed to show "where the time is going".
> 
> You initial accusation against set_flags was unfounded
> and led nowhere. But you have a very good point.
> 
> Your "fast" program is doing reads in blocks of 1024.
> Your "slow" program is using getc.
> 
> I observed that the slow program was 20 times slower
> than the fast one, even though strace showed that getc
> was properly calling read in blocks of 1024.
> 
> I then noticed that getc is not implemented as a macro
> on Cygwin. It's a newlib function

As you seem to care about a 20x speed increase, you can regain the
speed by editing stdio.h, letting getc be a macro on Cygwin.

Beware, I found this:
2000-05-19  DJ Delorie  <dj@cygnus.com>
	* libc/include/stdio.h: no getc/putc macros for cygwin; causes
	compatibility issues with different dll versions
so you may need to recompile when updating cygwin.

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/

