Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <4298DCE7.3050200@familiehaase.de> Date: Sat, 28 May 2005 23:04:39 +0200 From: "Gerrit P. Haase" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Serious performance problems (Gerrit/Danny please comment) References: <4297A14B DOT 9070409 AT plausible DOT org> <20050528131501 DOT V53507 AT logout DOT sh DOT cvut DOT cz> <20050528185720 DOT GA3015 AT trixie DOT casa DOT cgf DOT cx> In-Reply-To: <20050528185720.GA3015@trixie.casa.cgf.cx> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Christopher Faylor wrote: > 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. Wow, this is really worth to investigate. > Gerrit and Danny do you know what the difference between the mingw and > cygwin implementations of these functions might be? A quick look shows that there are basically no differences in these two files, but there a functions called which are defined in w32-shared-ptr.c, can you include this as well, please? These parts are Cygwin only: #ifdef __CYGWIN__ static void __w32_sharedptr_fixup_after_fork (void); #endif [...] #ifdef __CYGWIN__ /* recreate atom after fork */ pthread_atfork (NULL,NULL,__w32_sharedptr_fixup_after_fork); #endif [...] #ifdef __CYGWIN__ static void __w32_sharedptr_fixup_after_fork (void) { if (!__w32_sharedptr_set (__w32_sharedptr)) abort (); } #endif All the rest (in unwind-*) is shared. So the Cygwin version is slower for sure. I don't know why this is needed for Cygwin and not for MinGW, Danny? Gerrit -- =^..^= -- 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/