public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Cygwin slow on x64 systems
@ 2010-01-23 22:32 David Morgan
  2010-01-24  2:22 ` Vincent Richomme
  0 siblings, 1 reply; 43+ messages in thread
From: David Morgan @ 2010-01-23 22:32 UTC (permalink / raw)
  To: cygwin; +Cc: mlm

Hello all,

	We use cygwin for our build environment, and have observed that 
everything runs extremely slow on x64 systems, for versions newer than
approximately 1.5.12 (including 1.7.1).  When I run the following command
in BASH,

while true; do date >> file; done

on a 1.5.12 Core II system, I get approximately 100 dates per second.  
On a 1.7.1 Nehalem system, I get approximately 15, and it takes several
seconds for Ctrl-C to take effect, whereas it's instantaneous on 1.5.12.
It makes no difference whether I redirect the output or not.

We have found that the problem was introduced somewhere between 1.5.12 
and 1.5.24-2.   We have not seen any such slowdown on x86 systems.
We have observed this on XP x64, Server 2003 R2 x64, and now (with 1.7.1
only) on Windows 7 x64.

Can anyone recommend how we could profile this to help isolate the problem?
We have vTune and Quantify in-house.

Regards,

David


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-01-23 22:32 Cygwin slow on x64 systems David Morgan
@ 2010-01-24  2:22 ` Vincent Richomme
  2010-04-25  2:41   ` StephenBartlett
  0 siblings, 1 reply; 43+ messages in thread
From: Vincent Richomme @ 2010-01-24  2:22 UTC (permalink / raw)
  To: David Morgan; +Cc: cygwin

On Sat, 23 Jan 2010 11:19:36 -0600, David Morgan <dmorgan@aechelon.com>
wrote:
> Hello all,
> 
> 	We use cygwin for our build environment, and have observed that 
> everything runs extremely slow on x64 systems, for versions newer than
> approximately 1.5.12 (including 1.7.1).  When I run the following
command
> in BASH,
> 
> while true; do date >> file; done
> 
> on a 1.5.12 Core II system, I get approximately 100 dates per second.  
> On a 1.7.1 Nehalem system, I get approximately 15, and it takes several
> seconds for Ctrl-C to take effect, whereas it's instantaneous on 1.5.12.
> It makes no difference whether I redirect the output or not.
> 
> We have found that the problem was introduced somewhere between 1.5.12 
> and 1.5.24-2.   We have not seen any such slowdown on x86 systems.
> We have observed this on XP x64, Server 2003 R2 x64, and now (with 1.7.1
> only) on Windows 7 x64.
> 
> Can anyone recommend how we could profile this to help isolate the
problem?
> We have vTune and Quantify in-house.

Hope you will find something because I already have reported this but with
no success.
My QuadCore 3.GHz with 4GB feels like an old 386 when running cygwin on
Windows 7 64 bits!


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-01-24  2:22 ` Vincent Richomme
@ 2010-04-25  2:41   ` StephenBartlett
  2010-04-30  2:37     ` greenup greenup
  0 siblings, 1 reply; 43+ messages in thread
From: StephenBartlett @ 2010-04-25  2:41 UTC (permalink / raw)
  To: cygwin


Same problem here. Has anyone figured out what it is yet ?


Vincent Richomme-2 wrote:
> 
> On Sat, 23 Jan 2010 11:19:36 -0600, David Morgan <dmorgan@aechelon.com>
> wrote:
>> Hello all,
>> 
>> 	We use cygwin for our build environment, and have observed that 
>> everything runs extremely slow on x64 systems, for versions newer than
>> approximately 1.5.12 (including 1.7.1).  
> ... 
> 
> Hope you will find something because I already have reported this but with
> no success.
> My QuadCore 3.GHz with 4GB feels like an old 386 when running cygwin on
> Windows 7 64 bits!
> 
> 

-- 
View this message in context: http://old.nabble.com/Cygwin-slow-on-x64-systems-tp27288031p28354068.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-04-25  2:41   ` StephenBartlett
@ 2010-04-30  2:37     ` greenup greenup
  2010-04-30  3:06       ` NightStrike
  0 siblings, 1 reply; 43+ messages in thread
From: greenup greenup @ 2010-04-30  2:37 UTC (permalink / raw)
  To: cygwin

This is an old problem, the last I heard on it was something along the lines of:
"Cygwin's functionality/compatibility/robustness improved in necessary
ways, but performance was required to suffer"
From a hearsay perspective, it appears to be related to fork/exec
performance, and more specifically probably related to proper memory
allocation/management.

http://www.cygwin.com/ml/cygwin/2008-05/msg00387.html

I'd say "Try using Colinux", but they haven't gotten their 64 bit act
together yet.  (barely decided they're going to try)

One other time I was frustrated and got 50% improvement using a
smaller shell, (sh) but really that's a drop in the bucket,
performance-wise.

-greenup

On Sat, Apr 24, 2010 at 7:41 PM, StephenBartlett
<stephen.bartlett.us@gmail.com> wrote:

    Same problem here. Has anyone figured out what it is yet ?
    Vincent Richomme-2 wrote:
    > On Sat, 23 Jan 2010 11:19:36 -0600, David Morgan <dmorgan@aechelon.com>
    >>...

    >>      We use cygwin ...
    >> everything runs extremely slow

...

    > My QuadCore 3.GHz with 4GB feels like an old 386 when running cygwin on
    > Windows 7 64 bits!

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-04-30  2:37     ` greenup greenup
@ 2010-04-30  3:06       ` NightStrike
  2010-04-30 13:58         ` Edward Lam
  0 siblings, 1 reply; 43+ messages in thread
From: NightStrike @ 2010-04-30  3:06 UTC (permalink / raw)
  To: cygwin

On Thu, Apr 29, 2010 at 7:13 PM, greenup greenup <greenup@gmail.com> wrote:
> This is an old problem, the last I heard on it was something along the lines of:
> "Cygwin's functionality/compatibility/robustness improved in necessary
> ways, but performance was required to suffer"
> From a hearsay perspective, it appears to be related to fork/exec
> performance, and more specifically probably related to proper memory
> allocation/management.
>
> http://www.cygwin.com/ml/cygwin/2008-05/msg00387.html
>
> I'd say "Try using Colinux", but they haven't gotten their 64 bit act
> together yet.  (barely decided they're going to try)
>
> One other time I was frustrated and got 50% improvement using a
> smaller shell, (sh) but really that's a drop in the bucket,
> performance-wise.

Port cygwin to win64 via mingw-w64 :) :)

(We'll help if you can do it...)

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-04-30  3:06       ` NightStrike
@ 2010-04-30 13:58         ` Edward Lam
  2010-04-30 15:24           ` Christopher Faylor
  0 siblings, 1 reply; 43+ messages in thread
From: Edward Lam @ 2010-04-30 13:58 UTC (permalink / raw)
  To: cygwin

NightStrike wrote:
> Port cygwin to win64 via mingw-w64 :) :)

I'm not convinced that this will help. As mentioned already, there was a 
very specific change between cygwin releases that resulted in the slow 
down. It would be more helpful if someone actually compared the source, 
ran some profiles and figured out which change it was that actually 
caused the slowdown. From that, we can then properly assess the 
situation and decide on the best way to address it.

Regards,
-Edward

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-04-30 13:58         ` Edward Lam
@ 2010-04-30 15:24           ` Christopher Faylor
  0 siblings, 0 replies; 43+ messages in thread
From: Christopher Faylor @ 2010-04-30 15:24 UTC (permalink / raw)
  To: cygwin

On Fri, Apr 30, 2010 at 09:22:58AM -0400, Edward Lam wrote:
>NightStrike wrote:
>> Port cygwin to win64 via mingw-w64 :) :)
>
>I'm not convinced that this will help. As mentioned already, there was a 
>very specific change between cygwin releases that resulted in the slow 
>down. It would be more helpful if someone actually compared the source, 
>ran some profiles and figured out which change it was that actually 
>caused the slowdown. From that, we can then properly assess the 
>situation and decide on the best way to address it.

Please go right ahead and do that.  Welcome to the wonders of free software.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-27  1:19                         ` Yaakov (Cygwin/X)
@ 2010-09-27  1:36                           ` Christopher Faylor
  0 siblings, 0 replies; 43+ messages in thread
From: Christopher Faylor @ 2010-09-27  1:36 UTC (permalink / raw)
  To: cygwin

On Sun, Sep 26, 2010 at 12:42:38PM -0500, Yaakov (Cygwin/X) wrote:
>On Sun, 2010-09-26 at 10:58 -0400, Christopher Faylor wrote:
>> On Sun, Sep 26, 2010 at 12:54:58AM -0500, Yaakov (Cygwin/X) wrote:
>> >I've kept trying CVS HEAD with each revision, no change; other services
>> >fail with this Windows error?
>> >
>> >Error 1067: The process terminated unexpectedly.
>> >
>> >What further information can I provide?
>> 
>> I just activated some code that I'd hoped was unnecessary.  I'm building a
>> new snapshot now.  Could you try it when it shows up?
>
>Services now run normally with the 20100926 snapshot.  Thanks,

Sigh.  Too bad.  There's a noticeable slowdown from the additional code in
that snapshot.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-26 18:10                       ` Christopher Faylor
@ 2010-09-27  1:19                         ` Yaakov (Cygwin/X)
  2010-09-27  1:36                           ` Christopher Faylor
  0 siblings, 1 reply; 43+ messages in thread
From: Yaakov (Cygwin/X) @ 2010-09-27  1:19 UTC (permalink / raw)
  To: cygwin

On Sun, 2010-09-26 at 10:58 -0400, Christopher Faylor wrote:
> On Sun, Sep 26, 2010 at 12:54:58AM -0500, Yaakov (Cygwin/X) wrote:
> >I've kept trying CVS HEAD with each revision, no change; other services
> >fail with this Windows error?
> >
> >Error 1067: The process terminated unexpectedly.
> >
> >What further information can I provide?
> 
> I just activated some code that I'd hoped was unnecessary.  I'm building a
> new snapshot now.  Could you try it when it shows up?

Services now run normally with the 20100926 snapshot.  Thanks,


Yaakov



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-26 17:38                     ` Yaakov (Cygwin/X)
@ 2010-09-26 18:10                       ` Christopher Faylor
  2010-09-27  1:19                         ` Yaakov (Cygwin/X)
  0 siblings, 1 reply; 43+ messages in thread
From: Christopher Faylor @ 2010-09-26 18:10 UTC (permalink / raw)
  To: cygwin

On Sun, Sep 26, 2010 at 12:54:58AM -0500, Yaakov (Cygwin/X) wrote:
>On Sun, 2010-09-19 at 20:36 -0400, Christopher Faylor wrote:
>> On Sun, Sep 19, 2010 at 07:22:27PM -0500, Yaakov (Cygwin/X) wrote:
>> >cygserver starts but other services (messagebus, syslog-ng) do not with
>> >20100919 snapshot.
>> 
>> Ok, I'm back in "WJFFM" territory then.  I can start sshd, cygserver,
>> messagebus, and syslog-ng without problem.
>
>I've kept trying CVS HEAD with each revision, no change; other services
>fail with this Windows error?
>
>Error 1067: The process terminated unexpectedly.
>
>What further information can I provide?

I just activated some code that I'd hoped was unnecessary.  I'm building a
new snapshot now.  Could you try it when it shows up?

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-20  9:41                   ` Christopher Faylor
@ 2010-09-26 17:38                     ` Yaakov (Cygwin/X)
  2010-09-26 18:10                       ` Christopher Faylor
  0 siblings, 1 reply; 43+ messages in thread
From: Yaakov (Cygwin/X) @ 2010-09-26 17:38 UTC (permalink / raw)
  To: cygwin

On Sun, 2010-09-19 at 20:36 -0400, Christopher Faylor wrote:
> On Sun, Sep 19, 2010 at 07:22:27PM -0500, Yaakov (Cygwin/X) wrote:
> >cygserver starts but other services (messagebus, syslog-ng) do not with
> >20100919 snapshot.
> 
> Ok, I'm back in "WJFFM" territory then.  I can start sshd, cygserver,
> messagebus, and syslog-ng without problem.

I've kept trying CVS HEAD with each revision, no change; other services
fail with this Windows error?

Error 1067: The process terminated unexpectedly.

What further information can I provide?


Yaakov



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-20  9:40                 ` Yaakov (Cygwin/X)
@ 2010-09-20  9:41                   ` Christopher Faylor
  2010-09-26 17:38                     ` Yaakov (Cygwin/X)
  0 siblings, 1 reply; 43+ messages in thread
From: Christopher Faylor @ 2010-09-20  9:41 UTC (permalink / raw)
  To: cygwin

On Sun, Sep 19, 2010 at 07:22:27PM -0500, Yaakov (Cygwin/X) wrote:
>On Sun, 2010-09-19 at 19:35 -0400, Christopher Faylor wrote:
>> On Wed, Sep 08, 2010 at 10:49:53AM -0400, Christopher Faylor wrote:
>> >On Tue, Sep 07, 2010 at 01:54:14AM -0400, Christopher Faylor wrote:
>> >>On Thu, Sep 02, 2010 at 01:10:56AM -0400, Christopher Faylor wrote:
>> >>>On Wed, Sep 01, 2010 at 10:28:35PM -0500, Yaakov (Cygwin/X) wrote:
>> >>>>Services refuse to start with the 20100901 snapshot.  fork() does seem
>> >>>>to be faster, though (Win7 x64 RTM).
>> >>>
>> >>>sshd WJFFM, on XP at least.
>> >>
>> >>...but I can duplicate it on Vista 64.  I'll fix it tomorrow.
>> >
>> >This turned out to be more difficult to diagnose than I thought so it is
>> >not yet fixed.
>> 
>> It should be fixed now.  Please try the latest snapshot.
>
>cygserver starts but other services (messagebus, syslog-ng) do not with
>20100919 snapshot.

Ok, I'm back in "WJFFM" territory then.  I can start sshd, cygserver,
messagebus, and syslog-ng without problem.

What does the eventlog say?

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-20  8:55               ` Christopher Faylor
@ 2010-09-20  9:40                 ` Yaakov (Cygwin/X)
  2010-09-20  9:41                   ` Christopher Faylor
  0 siblings, 1 reply; 43+ messages in thread
From: Yaakov (Cygwin/X) @ 2010-09-20  9:40 UTC (permalink / raw)
  To: cygwin

On Sun, 2010-09-19 at 19:35 -0400, Christopher Faylor wrote:
> On Wed, Sep 08, 2010 at 10:49:53AM -0400, Christopher Faylor wrote:
> >On Tue, Sep 07, 2010 at 01:54:14AM -0400, Christopher Faylor wrote:
> >>On Thu, Sep 02, 2010 at 01:10:56AM -0400, Christopher Faylor wrote:
> >>>On Wed, Sep 01, 2010 at 10:28:35PM -0500, Yaakov (Cygwin/X) wrote:
> >>>>Services refuse to start with the 20100901 snapshot.  fork() does seem
> >>>>to be faster, though (Win7 x64 RTM).
> >>>
> >>>sshd WJFFM, on XP at least.
> >>
> >>...but I can duplicate it on Vista 64.  I'll fix it tomorrow.
> >
> >This turned out to be more difficult to diagnose than I thought so it is
> >not yet fixed.
> 
> It should be fixed now.  Please try the latest snapshot.

cygserver starts but other services (messagebus, syslog-ng) do not with
20100919 snapshot.


Yaakov



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-08 15:13             ` Christopher Faylor
@ 2010-09-20  8:55               ` Christopher Faylor
  2010-09-20  9:40                 ` Yaakov (Cygwin/X)
  0 siblings, 1 reply; 43+ messages in thread
From: Christopher Faylor @ 2010-09-20  8:55 UTC (permalink / raw)
  To: cygwin

On Wed, Sep 08, 2010 at 10:49:53AM -0400, Christopher Faylor wrote:
>On Tue, Sep 07, 2010 at 01:54:14AM -0400, Christopher Faylor wrote:
>>On Thu, Sep 02, 2010 at 01:10:56AM -0400, Christopher Faylor wrote:
>>>On Wed, Sep 01, 2010 at 10:28:35PM -0500, Yaakov (Cygwin/X) wrote:
>>>>On Wed, 2010-09-01 at 17:20 -0400, Christopher Faylor wrote:
>>>>> On Wed, Sep 01, 2010 at 03:19:15PM -0500, Heath Kehoe wrote:
>>>>> >If I put the original cygwin1.dll (1.7.7) back, everything works again. 
>>>>> >I also have sources, and built the latest from CVS, and that cygwin1.dll 
>>>>> >fails in the same way.
>>>>> 
>>>>> Sorry about that.  It should be fixed now.
>>>>> 
>>>>> http://cygwin.com/snapshots/
>>>>
>>>>Services refuse to start with the 20100901 snapshot.  fork() does seem
>>>>to be faster, though (Win7 x64 RTM).
>>>
>>>sshd WJFFM, on XP at least.
>>
>>...but I can duplicate it on Vista 64.  I'll fix it tomorrow.
>
>This turned out to be more difficult to diagnose than I thought so it is
>not yet fixed.

It should be fixed now.  Please try the latest snapshot.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-07  6:12           ` Christopher Faylor
  2010-09-07  7:42             ` Christopher Faylor
@ 2010-09-08 15:13             ` Christopher Faylor
  2010-09-20  8:55               ` Christopher Faylor
  1 sibling, 1 reply; 43+ messages in thread
From: Christopher Faylor @ 2010-09-08 15:13 UTC (permalink / raw)
  To: cygwin

On Tue, Sep 07, 2010 at 01:54:14AM -0400, Christopher Faylor wrote:
>On Thu, Sep 02, 2010 at 01:10:56AM -0400, Christopher Faylor wrote:
>>On Wed, Sep 01, 2010 at 10:28:35PM -0500, Yaakov (Cygwin/X) wrote:
>>>On Wed, 2010-09-01 at 17:20 -0400, Christopher Faylor wrote:
>>>> On Wed, Sep 01, 2010 at 03:19:15PM -0500, Heath Kehoe wrote:
>>>> >If I put the original cygwin1.dll (1.7.7) back, everything works again. 
>>>> >I also have sources, and built the latest from CVS, and that cygwin1.dll 
>>>> >fails in the same way.
>>>> 
>>>> Sorry about that.  It should be fixed now.
>>>> 
>>>> http://cygwin.com/snapshots/
>>>
>>>Services refuse to start with the 20100901 snapshot.  fork() does seem
>>>to be faster, though (Win7 x64 RTM).
>>
>>sshd WJFFM, on XP at least.
>
>...but I can duplicate it on Vista 64.  I'll fix it tomorrow.

This turned out to be more difficult to diagnose than I thought so it is
not yet fixed.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-07  6:12           ` Christopher Faylor
@ 2010-09-07  7:42             ` Christopher Faylor
  2010-09-08 15:13             ` Christopher Faylor
  1 sibling, 0 replies; 43+ messages in thread
From: Christopher Faylor @ 2010-09-07  7:42 UTC (permalink / raw)
  To: cygwin

On Tue, Sep 07, 2010 at 01:54:14AM -0400, Christopher Faylor wrote:
>On Thu, Sep 02, 2010 at 01:10:56AM -0400, Christopher Faylor wrote:
>>On Wed, Sep 01, 2010 at 10:28:35PM -0500, Yaakov (Cygwin/X) wrote:
>>>On Wed, 2010-09-01 at 17:20 -0400, Christopher Faylor wrote:
>>>> On Wed, Sep 01, 2010 at 03:19:15PM -0500, Heath Kehoe wrote:
>>>> >If I put the original cygwin1.dll (1.7.7) back, everything works again. 
>>>> >I also have sources, and built the latest from CVS, and that cygwin1.dll 
>>>> >fails in the same way.
>>>> 
>>>> Sorry about that.  It should be fixed now.
>>>> 
>>>> http://cygwin.com/snapshots/
>>>
>>>Services refuse to start with the 20100901 snapshot.  fork() does seem
>>>to be faster, though (Win7 x64 RTM).
>>
>>sshd WJFFM, on XP at least.
>
>...but I can duplicated it on Vista 64.  I'll fix it tomorrow.
              duplicate


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-02  5:11         ` Christopher Faylor
@ 2010-09-07  6:12           ` Christopher Faylor
  2010-09-07  7:42             ` Christopher Faylor
  2010-09-08 15:13             ` Christopher Faylor
  0 siblings, 2 replies; 43+ messages in thread
From: Christopher Faylor @ 2010-09-07  6:12 UTC (permalink / raw)
  To: cygwin

On Thu, Sep 02, 2010 at 01:10:56AM -0400, Christopher Faylor wrote:
>On Wed, Sep 01, 2010 at 10:28:35PM -0500, Yaakov (Cygwin/X) wrote:
>>On Wed, 2010-09-01 at 17:20 -0400, Christopher Faylor wrote:
>>> On Wed, Sep 01, 2010 at 03:19:15PM -0500, Heath Kehoe wrote:
>>> >If I put the original cygwin1.dll (1.7.7) back, everything works again. 
>>> >I also have sources, and built the latest from CVS, and that cygwin1.dll 
>>> >fails in the same way.
>>> 
>>> Sorry about that.  It should be fixed now.
>>> 
>>> http://cygwin.com/snapshots/
>>
>>Services refuse to start with the 20100901 snapshot.  fork() does seem
>>to be faster, though (Win7 x64 RTM).
>
>sshd WJFFM, on XP at least.

...but I can duplicated it on Vista 64.  I'll fix it tomorrow.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-06 17:36           ` Christopher Faylor
@ 2010-09-06 17:51             ` Sagi Ben-Akiva
  0 siblings, 0 replies; 43+ messages in thread
From: Sagi Ben-Akiva @ 2010-09-06 17:51 UTC (permalink / raw)
  To: cygwin


On 06/09/2010 19:29, Christopher Faylor wrote:
> On Mon, Sep 06, 2010 at 02:31:54PM +0300, Sagi Ben-Akiva wrote:
>> Hi Magnus,
>>
>> I applied your patch but I don't notice for any improvement in performance with
>> my test case (I still get only 7 lines/sec).
>>
>> I tried it with several cygwin 1.7.7-1 revisions
>> Which version of cygwin sources do you use ?
>> Did you try it with the latest snapshot ?
>
> Why are you trying obsolete patches when I've indicated that there is a
> fix available in the latest snapshot?
>
> cgf
>
Because with the snapshot that you published I still get slow performance.
I tried the cygwin1.dll snapshot from 2010-09-01 and from 2010-09-04.

Sagi.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-06 11:32         ` Sagi Ben-Akiva
@ 2010-09-06 17:36           ` Christopher Faylor
  2010-09-06 17:51             ` Sagi Ben-Akiva
  0 siblings, 1 reply; 43+ messages in thread
From: Christopher Faylor @ 2010-09-06 17:36 UTC (permalink / raw)
  To: cygwin

On Mon, Sep 06, 2010 at 02:31:54PM +0300, Sagi Ben-Akiva wrote:
>Hi Magnus,
>
>I applied your patch but I don't notice for any improvement in performance with 
>my test case (I still get only 7 lines/sec).
>
>I tried it with several cygwin 1.7.7-1 revisions
>Which version of cygwin sources do you use ?
>Did you try it with the latest snapshot ?

Why are you trying obsolete patches when I've indicated that there is a
fix available in the latest snapshot?

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-01 17:27       ` Magnus Holmgren
  2010-09-01 17:30         ` Eric Blake
@ 2010-09-06 11:32         ` Sagi Ben-Akiva
  2010-09-06 17:36           ` Christopher Faylor
  1 sibling, 1 reply; 43+ messages in thread
From: Sagi Ben-Akiva @ 2010-09-06 11:32 UTC (permalink / raw)
  To: cygwin

Hi Magnus,

I applied your patch but I don't notice for any improvement in performance with 
my test case (I still get only 7 lines/sec).

I tried it with several cygwin 1.7.7-1 revisions
Which version of cygwin sources do you use ?
Did you try it with the latest snapshot ?

Thanks,
   Sagi.

Magnus Holmgren wrote:
>>>> I did some testing on my 64-bit Vista system, and it appears that
>>>> CreateThread is the main cause.
>>>
>>> To test this, I removed the call to sigproc_init in dll_crt0_0 and made sure
>>> it was always called in dll_crt0_1 instead. Suddenly the sigp thread started
>>> executing immediately, and its initialization was complete long before
>>> wait_for_sigthread was called.
>>
>> Since you obviously have a patch, would you mind sharing it, rather than
>> just your conclusions from said patch?
>
> Not quite ready for commit as is, but here it is:
>
> Index: src/winsup/cygwin/dcrt0.cc
> ===================================================================
> RCS file: /cvs/src/src/winsup/cygwin/dcrt0.cc,v
> retrieving revision 1.382
> diff -r1.382 dcrt0.cc
> 746,747c746,747
> <    if (!dynamically_loaded)
> <      sigproc_init ();
> ---
>>    //if (!dynamically_loaded)
>>      //sigproc_init ();
> 792c792
> <    if (dynamically_loaded)
> ---
>>    //if (dynamically_loaded)
>
>    Magnus
>



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-02  3:28       ` Yaakov (Cygwin/X)
@ 2010-09-02  5:11         ` Christopher Faylor
  2010-09-07  6:12           ` Christopher Faylor
  0 siblings, 1 reply; 43+ messages in thread
From: Christopher Faylor @ 2010-09-02  5:11 UTC (permalink / raw)
  To: cygwin

On Wed, Sep 01, 2010 at 10:28:35PM -0500, Yaakov (Cygwin/X) wrote:
>On Wed, 2010-09-01 at 17:20 -0400, Christopher Faylor wrote:
>> On Wed, Sep 01, 2010 at 03:19:15PM -0500, Heath Kehoe wrote:
>> >If I put the original cygwin1.dll (1.7.7) back, everything works again. 
>> >I also have sources, and built the latest from CVS, and that cygwin1.dll 
>> >fails in the same way.
>> 
>> Sorry about that.  It should be fixed now.
>> 
>> http://cygwin.com/snapshots/
>
>Services refuse to start with the 20100901 snapshot.  fork() does seem
>to be faster, though (Win7 x64 RTM).

sshd WJFFM, on XP at least.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-01 21:21     ` Christopher Faylor
@ 2010-09-02  3:28       ` Yaakov (Cygwin/X)
  2010-09-02  5:11         ` Christopher Faylor
  0 siblings, 1 reply; 43+ messages in thread
From: Yaakov (Cygwin/X) @ 2010-09-02  3:28 UTC (permalink / raw)
  To: cygwin

On Wed, 2010-09-01 at 17:20 -0400, Christopher Faylor wrote:
> On Wed, Sep 01, 2010 at 03:19:15PM -0500, Heath Kehoe wrote:
> >If I put the original cygwin1.dll (1.7.7) back, everything works again. 
> >I also have sources, and built the latest from CVS, and that cygwin1.dll 
> >fails in the same way.
> 
> Sorry about that.  It should be fixed now.
> 
> http://cygwin.com/snapshots/
> 
> cgf

Services refuse to start with the 20100901 snapshot.  fork() does seem
to be faster, though (Win7 x64 RTM).


Yaakov



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-01 20:19   ` Heath Kehoe
@ 2010-09-01 21:21     ` Christopher Faylor
  2010-09-02  3:28       ` Yaakov (Cygwin/X)
  0 siblings, 1 reply; 43+ messages in thread
From: Christopher Faylor @ 2010-09-01 21:21 UTC (permalink / raw)
  To: cygwin

On Wed, Sep 01, 2010 at 03:19:15PM -0500, Heath Kehoe wrote:
>  On 9/1/2010 2:10 PM, Christopher Faylor wrote:
>> I rewrote the signal initialization stuff today and have generated a
>> new snapshot.  Please let me know if this works better for you.  I haven't
>> actually tried to run a fork per sec.  test yet so there may be other
>> lurking problems.
>>
>> http://cygwin.com/snapshots/
>
>On my Win7 x64 system, this snapshot (2010-09-01) doesn't work. Cygwin 
>commands fail to start without any output; and strace just outputs a 
>short exception message:
>
>c:\cygwin\bin>bash
>
>c:\cygwin\bin>strace bash
>--- Process 872, exception C0000005 at 6100600B
>
>c:\cygwin\bin>
>
>If I put the original cygwin1.dll (1.7.7) back, everything works again. 
>I also have sources, and built the latest from CVS, and that cygwin1.dll 
>fails in the same way.

Sorry about that.  It should be fixed now.

http://cygwin.com/snapshots/

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-01 19:10 ` Christopher Faylor
@ 2010-09-01 20:19   ` Heath Kehoe
  2010-09-01 21:21     ` Christopher Faylor
  0 siblings, 1 reply; 43+ messages in thread
From: Heath Kehoe @ 2010-09-01 20:19 UTC (permalink / raw)
  To: cygwin

  On 9/1/2010 2:10 PM, Christopher Faylor wrote:
> I rewrote the signal initialization stuff today and have generated a
> new snapshot.  Please let me know if this works better for you.  I haven't
> actually tried to run a fork per sec.  test yet so there may be other
> lurking problems.
>
> http://cygwin.com/snapshots/

On my Win7 x64 system, this snapshot (2010-09-01) doesn't work. Cygwin 
commands fail to start without any output; and strace just outputs a 
short exception message:

c:\cygwin\bin>bash

c:\cygwin\bin>strace bash
--- Process 872, exception C0000005 at 6100600B

c:\cygwin\bin>

If I put the original cygwin1.dll (1.7.7) back, everything works again. 
I also have sources, and built the latest from CVS, and that cygwin1.dll 
fails in the same way.

-heath

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-08-30 11:23 Sagi Ben-Akiva
                   ` (2 preceding siblings ...)
  2010-08-31 21:36 ` Magnus Holmgren
@ 2010-09-01 19:10 ` Christopher Faylor
  2010-09-01 20:19   ` Heath Kehoe
  3 siblings, 1 reply; 43+ messages in thread
From: Christopher Faylor @ 2010-09-01 19:10 UTC (permalink / raw)
  To: cygwin

On Mon, Aug 30, 2010 at 02:16:55PM +0300, Sagi Ben-Akiva wrote:
>For the last couple of weeks I'm trying to identify the cause for cygwin 
>slowdown on x64 machines which was reported by David Morgan about 6 
>months ago.
>
>Using cvsps I was able to generate a patchset which contains all the 
>changes between those 2 revisions.
>I then applied the changes one by one and built cygwin1.dll for each 
>change, then I ran my test script again for each cygwin1.dll version and 
>I found that the change to winsup/cygwin/dcrt0.cc from '2006/03/12 
>23:57:03' introduce this issue.
>
>The log for this change is :
>
>* dcrt0.cc (dll_crt0_0): Call sigproc_init during init startup.
>(_dll_crt0): Don't worry about sync_startup.  Just wait for sigthread here.
>
>This change includes 2 different sub-changes :
>1. Moving the call to sigproc_init from dll_crt0_1 function to 
>dll_crt0_0 - which doesn't affect performance.
>
>2. a. Moving the call to wait_for_sigthread from dll_crt0_1 to _dll_crt0 
>which calls dll_crt0_1.
>    b. Deleting the call to WaitForSingleObject,
>       i.e. : "Don't worry about sync_startup"
>
>I can confirm that the 2nd sub-change is the cause for the slowdown.
>
>Any help will be appreciated.

I rewrote the signal initialization stuff today and have generated a
new snapshot.  Please let me know if this works better for you.  I haven't
actually tried to run a fork per sec.  test yet so there may be other
lurking problems.

http://cygwin.com/snapshots/

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-01 17:12   ` Magnus Holmgren
  2010-09-01 17:15     ` Eric Blake
  2010-09-01 18:37     ` Christopher Faylor
@ 2010-09-01 19:00     ` Edward Lam
  2 siblings, 0 replies; 43+ messages in thread
From: Edward Lam @ 2010-09-01 19:00 UTC (permalink / raw)
  To: cygwin

On 9/1/2010 1:12 PM, Magnus Holmgren wrote:
>
> To test this, I removed the call to sigproc_init in dll_crt0_0 and made sure
> it was always called in dll_crt0_1 instead. Suddenly the sigp thread started
> executing immediately, and its initialization was complete long before
> wait_for_sigthread was called.

Note that Christopher Faylor (cgf) just committed a change today (rev 
1.383 dcrt0.cc) that removed the call to wait_for_sigthread() in 
dll_crt0_1().

-Edward

PS. Thanks for looking into this!

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-01 17:12   ` Magnus Holmgren
  2010-09-01 17:15     ` Eric Blake
@ 2010-09-01 18:37     ` Christopher Faylor
  2010-09-01 19:00     ` Edward Lam
  2 siblings, 0 replies; 43+ messages in thread
From: Christopher Faylor @ 2010-09-01 18:37 UTC (permalink / raw)
  To: cygwin

On Wed, Sep 01, 2010 at 05:12:19PM +0000, Magnus Holmgren wrote:
>Magnus Holmgren <magnushol <at> gmail.com> writes:
>
>> I did some testing on my 64-bit Vista system, and it appears that 
>> CreateThread is the main cause.
>
>I think I've found the reason for the slow CreateThread. It seems like
>the following remark in the MSDN documentation is relevant, at least for
>WOW64 processes:
>
> * During process startup and DLL initialization routines, new threads can
>   be created, but they do not begin execution until DLL initialization is
>   done for the process.

Which was precisely why sigproc_init was called there to begin with.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-01 17:30         ` Eric Blake
@ 2010-09-01 18:31           ` Daniel Colascione
  0 siblings, 0 replies; 43+ messages in thread
From: Daniel Colascione @ 2010-09-01 18:31 UTC (permalink / raw)
  To: cygwin

On Wed, Sep 1, 2010 at 10:30 AM, Eric Blake <eblake@redhat.com> wrote:
> Oh my poor eyes!  Context diffs (diff -u), please.
> http://cygwin.com/contrib.html describes how to form a proper patch
> submission (and it doesn't go to this list, either).

You mean unified diffs. Context diffs (-c) are also eyesores.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-01 17:27       ` Magnus Holmgren
@ 2010-09-01 17:30         ` Eric Blake
  2010-09-01 18:31           ` Daniel Colascione
  2010-09-06 11:32         ` Sagi Ben-Akiva
  1 sibling, 1 reply; 43+ messages in thread
From: Eric Blake @ 2010-09-01 17:30 UTC (permalink / raw)
  To: cygwin

On 09/01/2010 11:26 AM, Magnus Holmgren wrote:
>> Since you obviously have a patch, would you mind sharing it, rather than
>> just your conclusions from said patch?
>
> Not quite ready for commit as is, but here it is:

Oh my poor eyes!  Context diffs (diff -u), please.
http://cygwin.com/contrib.html describes how to form a proper patch 
submission (and it doesn't go to this list, either).

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-01 17:15     ` Eric Blake
@ 2010-09-01 17:27       ` Magnus Holmgren
  2010-09-01 17:30         ` Eric Blake
  2010-09-06 11:32         ` Sagi Ben-Akiva
  0 siblings, 2 replies; 43+ messages in thread
From: Magnus Holmgren @ 2010-09-01 17:27 UTC (permalink / raw)
  To: cygwin

Eric Blake <eblake <at> redhat.com> writes:

> >> I did some testing on my 64-bit Vista system, and it appears that
> >> CreateThread is the main cause.
> >
> > To test this, I removed the call to sigproc_init in dll_crt0_0 and made sure
> > it was always called in dll_crt0_1 instead. Suddenly the sigp thread started
> > executing immediately, and its initialization was complete long before
> > wait_for_sigthread was called.
> 
> Since you obviously have a patch, would you mind sharing it, rather than 
> just your conclusions from said patch?

Not quite ready for commit as is, but here it is:

Index: src/winsup/cygwin/dcrt0.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/dcrt0.cc,v
retrieving revision 1.382
diff -r1.382 dcrt0.cc
746,747c746,747
<   if (!dynamically_loaded)
<     sigproc_init ();
---
>   //if (!dynamically_loaded)
>     //sigproc_init ();
792c792
<   if (dynamically_loaded)
---
>   //if (dynamically_loaded)

  Magnus



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-09-01 17:12   ` Magnus Holmgren
@ 2010-09-01 17:15     ` Eric Blake
  2010-09-01 17:27       ` Magnus Holmgren
  2010-09-01 18:37     ` Christopher Faylor
  2010-09-01 19:00     ` Edward Lam
  2 siblings, 1 reply; 43+ messages in thread
From: Eric Blake @ 2010-09-01 17:15 UTC (permalink / raw)
  To: cygwin

On 09/01/2010 11:12 AM, Magnus Holmgren wrote:
> Magnus Holmgren<magnushol<at>  gmail.com>  writes:
>
>> I did some testing on my 64-bit Vista system, and it appears that
>> CreateThread is the main cause.
>
> To test this, I removed the call to sigproc_init in dll_crt0_0 and made sure
> it was always called in dll_crt0_1 instead. Suddenly the sigp thread started
> executing immediately, and its initialization was complete long before
> wait_for_sigthread was called.

Since you obviously have a patch, would you mind sharing it, rather than 
just your conclusions from said patch?

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-08-31 21:36 ` Magnus Holmgren
@ 2010-09-01 17:12   ` Magnus Holmgren
  2010-09-01 17:15     ` Eric Blake
                       ` (2 more replies)
  0 siblings, 3 replies; 43+ messages in thread
From: Magnus Holmgren @ 2010-09-01 17:12 UTC (permalink / raw)
  To: cygwin

Magnus Holmgren <magnushol <at> gmail.com> writes:

> I did some testing on my 64-bit Vista system, and it appears that 
> CreateThread is the main cause.

I think I've found the reason for the slow CreateThread. It seems like
the following remark in the MSDN documentation is relevant, at least for
WOW64 processes:

 * During process startup and DLL initialization routines, new threads can
   be created, but they do not begin execution until DLL initialization is
   done for the process.

To test this, I removed the call to sigproc_init in dll_crt0_0 and made sure 
it was always called in dll_crt0_1 instead. Suddenly the sigp thread started 
executing immediately, and its initialization was complete long before 
wait_for_sigthread was called.

Even with this change, a "date loop" isn't blazingly fast on my computer
(cygwin1.dll created from 1.7.7 sources, first number is executions per
second):

     26 Wed Sep  1 18:47:36 WEDT 2010
     27 Wed Sep  1 18:47:37 WEDT 2010
     26 Wed Sep  1 18:47:38 WEDT 2010

But it is a clear improvement (using the stock 1.7.6 dll):

      9 Wed Sep  1 18:52:35 WEDT 2010
      9 Wed Sep  1 18:52:36 WEDT 2010
      9 Wed Sep  1 18:52:37 WEDT 2010

PS. There are a few trace printfs in cygthread::create that uses "name" in 
the argument list to print the thread name. That doesn't work nearly as well 
as "__name". :)

  Magnus



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-08-30 11:23 Sagi Ben-Akiva
  2010-08-30 14:26 ` Edward Lam
  2010-08-30 16:53 ` Edward Lam
@ 2010-08-31 21:36 ` Magnus Holmgren
  2010-09-01 17:12   ` Magnus Holmgren
  2010-09-01 19:10 ` Christopher Faylor
  3 siblings, 1 reply; 43+ messages in thread
From: Magnus Holmgren @ 2010-08-31 21:36 UTC (permalink / raw)
  To: cygwin

Sagi Ben-Akiva <sagi <at> graphtech.co.il> writes:

> For the last couple of weeks I'm trying to identify the cause for cygwin 
> slowdown on x64 machines which was reported by David Morgan about 6 
> months ago.

<...>

> Any help will be appreciated.

I did some testing on my 64-bit Vista system, and it appears that 
CreateThread is the main cause. I added a few traces, and got this:

$ strace --mask=thread,sigp date
  149     149 [main] date 2944 cygthread::create: name ...
  159     308 [main] date 2944 cygthread::create: created name ...
 6241    6549 [main] date 2944 wait_for_sigthread: wait_sig_inited 0xB0
23606   30155 [sig] date 2944 cygthread::stub: cygthread::stub enter
  111   30266 [sig] date 2944 cygthread::stub: cygthread::stub callfunc
   65   30331 [sig] date 2944 cygthread::callfunc: wait for 'h'
   59   30390 [sig] date 2944 cygthread::callfunc: func
   65   30455 [sig] date 2944 init_sig_pipe: enter
 5343   35798 [sig] date 2944 init_sig_pipe: create pipe
  134   35932 [sig] date 2944 init_sig_pipe: exit
   72   36004 [sig] date 2944 wait_sig: entering ReadFile loop ...
    4   36008 [main] date 2944 wait_for_sigthread: process/signal ...

The second trace line is printed after CreateThread has returned, and the 
fourth line is the first thing executed in the new thread (don't know if it 
is a good idea to trace that early in the thread, but...).

  Magnus



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-08-31 17:41   ` Magnus Holmgren
@ 2010-08-31 19:23     ` Christopher Faylor
  0 siblings, 0 replies; 43+ messages in thread
From: Christopher Faylor @ 2010-08-31 19:23 UTC (permalink / raw)
  To: cygwin

On Tue, Aug 31, 2010 at 05:26:24PM +0000, Magnus Holmgren wrote:
>Christopher Faylor <cgf-use-the-mailinglist-please <at> cygwin.com> writes:
>>Here's what I'm saying: It makes absolutely no sense that moving the
>>call would have any effect.  The code is the way it is for a reason so
>>we're not going to just revert the change.
>
>I think it makes sense, if the signal thread initialization takes time.
>Which it does:
>
>69 15954 [main] date 2708 wait_for_sigthread: wait_sig_inited 0x4C
>13706 29660 [main] date 2708 wait_for_sigthread: process/signal
>handling enabled, state 0x41 146 29806 [sig] date 2708 wait_sig:
>entering ReadFile loop, my_readsig 0xFC, my_sendsig 0x100
>
>The above is a snippet from "strace date" (with some wrapping by me),
>using Cygwin 1.7.6 on Vista x64.  And 1.7.7 is said to be slower still
>- and guess what, sigproc_init is called later; see r1.382 of dcrt0.cc.

You are using a different value of "makes sense".  I was not saying
"Your observations are wrong".  If I was saying that then yes, you would
not be making sense.  Yes, if a function takes longer than you want it
to, then it will cause things to be slow.  That does make sense but it
is basically a tautology.

I am saying that looking at the code, it does not make sense that it would take
longer.  It especially does not make any sense given the fact that the signal
thread does not get started until well after dll_crt0_0 has exited, so, moving
the sigproc_init should not cause any difference in behavior.  And, you really
haven't proved that it does since you are checking the difference between 1.7.6
and 1.7.7 and there have been many changes between those two.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-08-31 14:19 ` Christopher Faylor
  2010-08-31 15:12   ` Edward Lam
@ 2010-08-31 17:41   ` Magnus Holmgren
  2010-08-31 19:23     ` Christopher Faylor
  1 sibling, 1 reply; 43+ messages in thread
From: Magnus Holmgren @ 2010-08-31 17:41 UTC (permalink / raw)
  To: cygwin

Christopher Faylor <cgf-use-the-mailinglist-please <at> cygwin.com> writes:

> Here's what I'm saying:  It makes absolutely no sense that moving the
> call would have any effect.  The code is the way it is for a reason
> so we're not going to just revert the change.

I think it makes sense, if the signal thread initialization takes time.
Which it does:

   69   15954 [main] date 2708 wait_for_sigthread: wait_sig_inited 0x4C
13706   29660 [main] date 2708 wait_for_sigthread: process/signal handling
                               enabled, state 0x41
  146   29806 [sig] date 2708 wait_sig: entering ReadFile loop, my_readsig 0xFC,
                              my_sendsig 0x100

The above is a snippet from "strace date" (with some wrapping by me), using
Cygwin 1.7.6 on Vista x64. And 1.7.7 is said to be slower still - and guess
what, sigproc_init is called later; see r1.382 of dcrt0.cc.

  Magnus



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-08-31 15:12   ` Edward Lam
@ 2010-08-31 16:48     ` Christopher Faylor
  0 siblings, 0 replies; 43+ messages in thread
From: Christopher Faylor @ 2010-08-31 16:48 UTC (permalink / raw)
  To: cygwin

On Tue, Aug 31, 2010 at 10:18:39AM -0400, Edward Lam wrote:
>On 8/31/2010 10:08 AM, Christopher Faylor wrote:
>>Here's what I'm saying: It makes absolutely no sense that moving the
>>call would have any effect.  The code is the way it is for a reason so
>>we're not going to just revert the change.
>
>I don't think anyone is asking to revert the change.

Don't be too sure.  I'm sure that is the knee-jerk reaction of many
reading the observations.

>In any case, is it absolutely necessary for us to call 
>wait_for_sigthread() before we do the other initialization in 
>dll_crt0_1() ? ie. can we move it further down? Or perhaps we can 
>reorder the initialization code somewhat such that we can do more work 
>before calling wait_for_sigthread()?

If you are capable of building from source then you can answer these
questions for yourself.  This is not terrifically complicated code we're
talking about here.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-08-31 14:19 ` Christopher Faylor
@ 2010-08-31 15:12   ` Edward Lam
  2010-08-31 16:48     ` Christopher Faylor
  2010-08-31 17:41   ` Magnus Holmgren
  1 sibling, 1 reply; 43+ messages in thread
From: Edward Lam @ 2010-08-31 15:12 UTC (permalink / raw)
  To: cygwin

On 8/31/2010 10:08 AM, Christopher Faylor wrote:
>
> Here's what I'm saying:  It makes absolutely no sense that moving the
> call would have any effect.  The code is the way it is for a reason
> so we're not going to just revert the change.

I don't think anyone is asking to revert the change.

In any case, is it absolutely necessary for us to call 
wait_for_sigthread() before we do the other initialization in 
dll_crt0_1() ? ie. can we move it further down? Or perhaps we can 
reorder the initialization code somewhat such that we can do more work 
before calling wait_for_sigthread()?

Regards,
-Edward

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-08-31  7:18 Roland Schwingel
@ 2010-08-31 14:19 ` Christopher Faylor
  2010-08-31 15:12   ` Edward Lam
  2010-08-31 17:41   ` Magnus Holmgren
  0 siblings, 2 replies; 43+ messages in thread
From: Christopher Faylor @ 2010-08-31 14:19 UTC (permalink / raw)
  To: cygwin

On Tue, Aug 31, 2010 at 08:32:41AM +0200, Roland Schwingel wrote:
>Hi Sagi and all others,
>
>Thanks Sagi for your investigation!
>
>This is great news that it could finally be tracked down. I am also 
>suffering badly here from this
>speed drop. I haven't yet tried myself to revert this change to see 
>whether it brings back speed
>but will certainly try to do so soon.
>
>What are our cygwin gurus (CGF,Corinna,?) saying about this?  Can the
>results of these investigations be incorporated in a change in an
>upcoming version to get a more performant cygwin version?

Here's what I'm saying:  It makes absolutely no sense that moving the
call would have any effect.  The code is the way it is for a reason
so we're not going to just revert the change.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-08-30 16:53 ` Edward Lam
@ 2010-08-31 13:04   ` Sagi Ben-Akiva
  0 siblings, 0 replies; 43+ messages in thread
From: Sagi Ben-Akiva @ 2010-08-31 13:04 UTC (permalink / raw)
  To: cygwin

Edward Lam wrote:

> Just curious, has the performance characteristics of your test changed
> with the lastest cygwin snapshot? The affected code has moved somewhat
> since revision 1.288.


I ran my test script on version 1.7.6 and
on the release from today, i.e. 1.7.7-1,
and performance are even worse.
I get only 5 lines/second.

Sagi.


-- 
Sagi Ben-Akiva - sagi at graphtech dot co dot il
GraphTech Computer Systems,
www.graphtech.co.il

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
@ 2010-08-31  7:18 Roland Schwingel
  2010-08-31 14:19 ` Christopher Faylor
  0 siblings, 1 reply; 43+ messages in thread
From: Roland Schwingel @ 2010-08-31  7:18 UTC (permalink / raw)
  To: cygwin

Hi Sagi and all others,

Thanks Sagi for your investigation!

This is great news that it could finally be tracked down. I am also 
suffering badly here from this
speed drop. I haven't yet tried myself to revert this change to see 
whether it brings back speed
but will certainly try to do so soon.

What are our cygwin gurus (CGF,Corinna,?) saying about this? Can the 
results of these
investigations be incorporated in a change in an upcoming version to get 
a more performant
cygwin version? I know that in 1.7 codebase a lot has changed so it 
might not be that easy
to transport these results to the current version.

Beside of the fork problems the speed drop is (in my eyes) the other big 
problem of cygwin on x64.

Thanks in advance,

Roland, hoping that this problem gets cured soon



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-08-30 11:23 Sagi Ben-Akiva
  2010-08-30 14:26 ` Edward Lam
@ 2010-08-30 16:53 ` Edward Lam
  2010-08-31 13:04   ` Sagi Ben-Akiva
  2010-08-31 21:36 ` Magnus Holmgren
  2010-09-01 19:10 ` Christopher Faylor
  3 siblings, 1 reply; 43+ messages in thread
From: Edward Lam @ 2010-08-30 16:53 UTC (permalink / raw)
  To: cygwin

On 8/30/2010 7:16 AM, Sagi Ben-Akiva wrote:
> 2. a. Moving the call to wait_for_sigthread from dll_crt0_1 to _dll_crt0
> which calls dll_crt0_1.
> b. Deleting the call to WaitForSingleObject,
> i.e. : "Don't worry about sync_startup"
>
> I can confirm that the 2nd sub-change is the cause for the slowdown.

Just curious, has the performance characteristics of your test changed 
with the lastest cygwin snapshot? The affected code has moved somewhat 
since revision 1.288.

I wonder if we can move the call to wait_for_sigthread() further down in 
dll_crt0_0() to improve performance via concurrency. Perhaps as far down 
as right before we assign cygwin_finished_initializing to true?

At first brush, it looks like the slowdown is caused by the slow thread 
startup. I wouldn't expect that Win64 thread start up to be any slower 
than Win32 but perhaps this is due to Wow64. MSDN [1] does document that 
there is some (small) extra thread allocation when on WOW64. Perhaps 
some independent testing in this regard might be helpful.

Regards,
-Edward

1. http://msdn.microsoft.com/en-us/library/aa384219%28VS.85%29.aspx

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Cygwin slow on x64 systems
  2010-08-30 11:23 Sagi Ben-Akiva
@ 2010-08-30 14:26 ` Edward Lam
  2010-08-30 16:53 ` Edward Lam
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 43+ messages in thread
From: Edward Lam @ 2010-08-30 14:26 UTC (permalink / raw)
  To: cygwin

On 8/30/2010 7:16 AM, Sagi Ben-Akiva wrote:
> For the last couple of weeks I'm trying to identify the cause for
> cygwin slowdown on x64 machines which was reported by David Morgan
> about 6 months ago.

You're my new hero. :)

> I then applied the changes one by one and built cygwin1.dll for each
> change, then I ran my test script again for each cygwin1.dll version
> and I found that the change to winsup/cygwin/dcrt0.cc from
> '2006/03/12 23:57:03' introduce this issue.

For anyone interested in this, it's revision 1.288 of dcrt0.cc
Web CVS link:
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/dcrt0.cc?cvsroot=src

-Edward

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Cygwin slow on x64 systems
@ 2010-08-30 11:23 Sagi Ben-Akiva
  2010-08-30 14:26 ` Edward Lam
                   ` (3 more replies)
  0 siblings, 4 replies; 43+ messages in thread
From: Sagi Ben-Akiva @ 2010-08-30 11:23 UTC (permalink / raw)
  To: cygwin

Hello,

For the last couple of weeks I'm trying to identify the cause for cygwin 
slowdown on x64 machines which was reported by David Morgan about 6 
months ago.

I wrote a little bash script which prints the result of 'date -s' to a 
file in a loop and then counts the number of times the same second 
appears in that file.
I used this script to test all available cygwin revisions snapshots 
(which I downloaded from 
ftp://www.fruitbat.org/pub/cygwin/circa/index.html) for cygwin version 
1.5.19-4.
I was able to identify the exact change which introduce the slowdown.

With my test script for cygwin version 1.5.19-4, snapshot timestamp 
1142005204 I'm able to get ~40 lines/second, but with the same version, 
snapshot timestamp 1142338816 the result is ~18 lines/second.

Using cvsps I was able to generate a patchset which contains all the 
changes between those 2 revisions.
I then applied the changes one by one and built cygwin1.dll for each 
change, then I ran my test script again for each cygwin1.dll version and 
I found that the change to winsup/cygwin/dcrt0.cc from '2006/03/12 
23:57:03' introduce this issue.

The log for this change is :

* dcrt0.cc (dll_crt0_0): Call sigproc_init during init startup.
(_dll_crt0): Don't worry about sync_startup.  Just wait for sigthread here.

This change includes 2 different sub-changes :
1. Moving the call to sigproc_init from dll_crt0_1 function to 
dll_crt0_0 - which doesn't affect performance.

2. a. Moving the call to wait_for_sigthread from dll_crt0_1 to _dll_crt0 
which calls dll_crt0_1.
    b. Deleting the call to WaitForSingleObject,
       i.e. : "Don't worry about sync_startup"

I can confirm that the 2nd sub-change is the cause for the slowdown.

Any help will be appreciated.

Thank you,
   Sagi.

-- 

Sagi Ben-Akiva - sagi at graphtech dot co dot il
GraphTech Computer Systems




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2010-09-26 18:10 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-23 22:32 Cygwin slow on x64 systems David Morgan
2010-01-24  2:22 ` Vincent Richomme
2010-04-25  2:41   ` StephenBartlett
2010-04-30  2:37     ` greenup greenup
2010-04-30  3:06       ` NightStrike
2010-04-30 13:58         ` Edward Lam
2010-04-30 15:24           ` Christopher Faylor
2010-08-30 11:23 Sagi Ben-Akiva
2010-08-30 14:26 ` Edward Lam
2010-08-30 16:53 ` Edward Lam
2010-08-31 13:04   ` Sagi Ben-Akiva
2010-08-31 21:36 ` Magnus Holmgren
2010-09-01 17:12   ` Magnus Holmgren
2010-09-01 17:15     ` Eric Blake
2010-09-01 17:27       ` Magnus Holmgren
2010-09-01 17:30         ` Eric Blake
2010-09-01 18:31           ` Daniel Colascione
2010-09-06 11:32         ` Sagi Ben-Akiva
2010-09-06 17:36           ` Christopher Faylor
2010-09-06 17:51             ` Sagi Ben-Akiva
2010-09-01 18:37     ` Christopher Faylor
2010-09-01 19:00     ` Edward Lam
2010-09-01 19:10 ` Christopher Faylor
2010-09-01 20:19   ` Heath Kehoe
2010-09-01 21:21     ` Christopher Faylor
2010-09-02  3:28       ` Yaakov (Cygwin/X)
2010-09-02  5:11         ` Christopher Faylor
2010-09-07  6:12           ` Christopher Faylor
2010-09-07  7:42             ` Christopher Faylor
2010-09-08 15:13             ` Christopher Faylor
2010-09-20  8:55               ` Christopher Faylor
2010-09-20  9:40                 ` Yaakov (Cygwin/X)
2010-09-20  9:41                   ` Christopher Faylor
2010-09-26 17:38                     ` Yaakov (Cygwin/X)
2010-09-26 18:10                       ` Christopher Faylor
2010-09-27  1:19                         ` Yaakov (Cygwin/X)
2010-09-27  1:36                           ` Christopher Faylor
2010-08-31  7:18 Roland Schwingel
2010-08-31 14:19 ` Christopher Faylor
2010-08-31 15:12   ` Edward Lam
2010-08-31 16:48     ` Christopher Faylor
2010-08-31 17:41   ` Magnus Holmgren
2010-08-31 19:23     ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).