On Sun, May 29, 2005 at 12:32:53AM +0200, Gerrit P. Haase wrote: >Danny Smith wrote: > >>Re: Serious performance problems (Gerrit/Danny please comment) >>From: Christopher Faylor <cgf-no-personal-reply-please at cygwin dot com> >>To: cygwin at cygwin dot com >>Date: Sat, 28 May 2005 14:57:20 -0400 >>Subject: Re: Serious performance problems (Gerrit/Danny please comment) >>References: <http://sources.redhat.com/ml/cygwin/2005-05/msg01305.html> >><http://sources.redhat.com/ml/cygwin/2005-05/msg01319.html> >>Reply-to: cygwin at cygwin dot com >> >>-------------------------------------------------------------------------------- >> >> >>>On Sat, May 28, 2005 at 01:24:31PM +0200, Vaclav Haisman wrote: >>> >>>>Somebody mentioned that malloc implementation could be the problem. >>>>Dunno. I >>>>has also crossed my mind that another difference between FreeBSD and >>>>Cygwin >> >>is >> >>>>implementation of C++ exceptions. Maybe the SJLJ implementation that >>>>Cygwin >>>>AFAIK uses has too big overhead. >>> >>>To test this theory, I just tried replacing Cygwin's "Unwind" functions >>>with those from mingw and saw a noticeable speed up in the execution of >>>this program. I did this by extracting the contents of mingw's libgcc >>>to a directory and then including unwind-c.o and unwind-sjlj.o on the >>>command line when linking the test case. I had to modify the test case >>>by adding these two lines to the bottom: >>> >>> int __mingwthr_key_dtor; >>> int _CRT_MT; >>> >>>to avoid undefined symbol errors so this is obviously not intended as a >>>complete solution. >>> >>>On doing this, the program went from taking 25 seconds to execute to >>>taking 7 seconds to execute. That's still 4x slower than mingw but it >>>is, nonetheless, a noticeable difference. >>> >>>Gerrit and Danny do you know what the difference between the mingw and >>>cygwin implementations of these functions might be? >>> >> >> >>I too suspect sjlj exceptions to be the problem. This has already been >>reported on GCC lists: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14563 >> >>The sjlj overhead affects both cygwun and mingw, but cygwin has the >>additional overhead of posix threads to ensure thread-safe allocation >>and destruction of structures used by exception handling, while mingw >>uses win32api directly >>(In CRT_MT == 0 case, it doesn't even bother cleaning up) > >As I thought before, the only difference is buried in w32-shared-ptr.c: > >$ g++ -o cygspd-mingw cygspd-mingw.o > >$ time ./cygspd-mingw cygspd.dat > >real 0m51.071s >user 0m50.108s >sys 0m0.046s > >cgf, your box must be really fast if this lasts half the time than it >lasts for me and I have already a really fast box;)
It's pretty fast. This is my famous "hyperthreading machine" running XP SP2, 3.0GHZ with 1G of memory. I sometimes think that this new machine tries harder to obscure cygwin bugs than my old machine did. cygspd runs in 25 - 26 seconds. cygspd-mingw runs in 2 seconds. If I create dummy versions of pthread_{getspecific,setspecific,mutex_lock,mutex_unlock} then the cygwin version is about a second slower than the mingw version. 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/