On Sun, Jun 27, 2004 at 05:29:50PM -0400, Pierre A. Humblet wrote: >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 :(
Sorry to hear that. I've been going through hard disk problems myself. Thanks for verifying that the change worked. cgf -- 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/