Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
X-Originating-IP: [212.54.79.25]
From: "Jonas Jensen" <bones0_list@hotmail.com>
To: "Cygwin List" <cygwin@sources.redhat.com>
Subject: printf is faster when piped through tee
Date: Sat, 2 Sep 2000 16:11:08 +0200
MIME-Version: 1.0
Content-Type: text/plain;	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Message-ID: <OE9jWwY0VnkB4ltFlmm000000a8@hotmail.com>
X-OriginalArrivalTime: 02 Sep 2000 14:11:25.0210 (UTC) FILETIME=[ADCA6FA0:01C014E7]

Something's wrong with the performance of printf. When compiling with gcc,
printf executes much slower than with Microsoft's "cl". The funny thing is
that when I pipe those programs through "tee", they're both (equally) fast.

This is my test program:
------------------------------------------------
#include <stdio.h>
#include <stdlib.h>

void main(int argc, char** argv)
{
   register int i;
   if (argc != 2) return 1;
   i = atoi(argv[1]);
   while (i--)
      printf("%i bottles of beer on the wall...\n", i);
}
------------------------------------------------

Here are the scores of 1000 loops through this program, in seconds, measured
with the "time" keyword in bash.

cl: 0.561
gcc: 10.055
gcc/tee: 0.861
cl/tee 0.861

It appears that there's a way to print faster, because "cat" has no problem,
while "ls" and others suffer badly from it.
Can anyone explain/fix this?

I'm using Win2k, Cygwin 1.1.4.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

