stderr outputs veerrrryyy slowly

Christopher Faylor cgf-rcm@cygwin.com
Fri Jun 20 02:28:00 GMT 2003


On Thu, Jun 19, 2003 at 10:02:15PM -0400, Larry Hall wrote:
>Brian Dessent wrote:
>>Larry Hall wrote:
>>>Works for me fine either way.  Perhaps providing information
>>>requested by <http://cygwin.com/problems.html> will shed some light.
>>>Perhaps not.
>>>
>>>You could try it with strace and post the results too.
>>
>>Ok, attached should be the cygcheck -srv output.  Also, the strace log
>>for running "tidy" on a html file is at
>><http://www.dessent.net/tmp/strace.txt>  It's pretty big, about 17000
>>lines.  Of interest are two things:
>>
>>Running it under strace fixes the problem (!!) more or less.  The output
>>is much faster, although not quite as fast as you would expect for
>>console output:
>>
>>time strace -o strace.out tidy -o foo test.html
>>...
>>real    0m4.640s
>>user    0m0.010s
>>sys     0m0.020s
>>
>>time tidy -o foo test.html
>>...
>>real    0m39.301s
>>user    0m0.070s
>>sys     0m0.020s
>
>OK, I have been able to reproduce this to some extent.  I'm using 'curl
>-o /dev/null http://www.google.com' which times in at about 1.5 to 2
>seconds with 'tty' and about .5 seconds without.  I don't have any
>additional data at this point but I thought I'd "chime in" with a "me
>too", since I know that's what this list is all about.  ;-) Actually, I
>wanted to let Brian and any others know that this doesn't appear to be
>specific to their configuration.  If I find out more, I'll report back.

This crops up on the cygwin list from time to time.

IIRC, if you use 'setbuf(f, NULL)' in newlib (as is the case for
stderr), it causes newlib to flush on every character.  I submitted a
patch to fix this behavior many years ago but it was rejected.  I think
the rationale was basically a "This isn't broken.  We're allowed to do
this" but I don't really recall exactly why the patch was rejected.

cgf
--
Please use the resources at cygwin.com rather than sending personal email.
Special for spam email harvesters: send email to aaaspam@sourceware.org
and be permanently blocked from mailing lists at sources.redhat.com

--
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/



More information about the Cygwin mailing list