public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Cygwin is SLOW.
@ 2002-07-16  3:25 David E. Weekly
  2002-07-16  8:20 ` Bernard A Badger
  0 siblings, 1 reply; 12+ messages in thread
From: David E. Weekly @ 2002-07-16  3:25 UTC (permalink / raw)
  To: cygwin

Modern cygwins seem to be very slow. "Modern" meaning built within the last
6 months or so, and "slow" means that many basic file operations, such as
"chmod", seem to be >10x slower (measured, not exaggerating) than previous
cygwins. This is creating a pretty tight situation at our company as we're
having to rewrite scripts, etc, to work around this. The sample test script
below should demonstrate the problem. With "old" cygwins I got nearly 1000
chmod's second on my workstation. With "new" cygwins I get under a dozen.
The comparison was done on the same machine, same filesystem (NTFS) with
otherwise identical conditions.

Have others been running into this? We're seeing this on all the machines at
our company, so I'm pretty convinced it's not just a localized wierdness or
misconfiguration. We'd love to be using Cygwin, but we may have to bail if
we can't get it to run acceptably fast.

-david


=====================================


chmod ( 000, "test.file" ) || die "chmod test.file: $!";
-w "test.file" || die "cannot change test.file's permissions" $!";
$t = time;
while( $t == time ) {}
$t = time;
$secs = 5;
$stop = $t + $secs;
while( time < $stop ) {
  system( "chmod 777 test.file" ) == 0 or die "blah, $!";
  $n++;
}
print $n / $secs, " chmods per sec\n";
-w "test.file" || die "test.file is not writeable: $!";


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* RE: Cygwin is SLOW.
  2002-07-16  3:25 Cygwin is SLOW David E. Weekly
@ 2002-07-16  8:20 ` Bernard A Badger
  2002-07-16  8:31   ` Bernard A Badger
                     ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Bernard A Badger @ 2002-07-16  8:20 UTC (permalink / raw)
  To: David E. Weekly, cygwin

Well, it might help to identify the "test script" as a perl script.
Plus, you got an extra double-quote in there.  This script has a chance
of running:
#!/usr/local/bin/perl
chmod ( 000, "test.file" ) || die "chmod test.file: $!";
-w "test.file" || die "cannot change test.file's permissions $!";
$t = time;
while( $t == time ) {}
$t = time;
$secs = 5;
$stop = $t + $secs;
while( time < $stop ) {
  system( "chmod 777 test.file" ) == 0 or die "blah, $!";
  $n++;
}
print $n / $secs, " chmods per sec\n";
-w "test.file" || die "test.file is not writeable: $!";



However, I find that I get a rather odd result: 
The script reports failure, even though it successfully changes the mode.
$ chmod 555 test.file

bab@PORT /D/site/src/cwt
$ ll
total 2
-rw-rw-rw-    1 bab      DomUsers      408 Jul 16 13:33 chm
-rw-rw-rw-    1 bab      DomUsers      409 Jul 16 13:32 chm~
-r-xr-xr-x    1 bab      DomUsers        0 Jul 16 13:28 test.file

bab@PORT /D/site/src/cwt
$ ./chm
cannot change test.file's permissions Permission denied at ./chm line 3.

bab@PORT /D/site/src/cwt
$ ll
total 2
-rw-rw-rw-    1 bab      DomUsers      408 Jul 16 13:33 chm
-rw-rw-rw-    1 bab      DomUsers      409 Jul 16 13:32 chm~
----------    1 bab      DomUsers        0 Jul 16 13:28 test.file


Hmm, I guess you've got another error:
Here's the fix:
#!/usr/local/bin/perl
chmod ( 000, "test.file" ) || die "chmod test.file: $!";
-w "test.file" && die "cannot change test.file's permissions $!";
$t = time;
while( $t == time ) {}
$t = time;
$secs = 5;
$stop = $t + $secs;
while( time < $stop ) {
  system( "chmod 777 test.file" ) == 0 or die "blah, $!";
  $n++;
}
print $n / $secs, " chmods per sec\n";
-w "test.file" || die "test.file is not writeable: $!";


$ ./chm
41 chmods per sec

Yep, that's slow.

Next time, try pasting the _actual_ script that you're using.

But it's not as slow as this older perl:
$ /Y/depot/winnt/perl/5.00501/bin/mswin32-x86/perl.exe chm
5 chmods per sec

In this case, y: is a network mapped drive.  That probably hurts.
In fact for this case, which chmod is
D:\site\src\cwt>which chmod
y:/depot/winnt/bin/chmod.exe

You're script isn't just doing chmod, though, it's doing SYSTEM chmod.

So, chmod has to be searched for over my path, and ends up coming over the
network.  No wonder it's slow.

Under Cygwin Bash, the PATH is different, so 
$ which chmod
/usr/bin/chmod

Which is a local cygwin mount drive.  

If you want it to run fast, avoid system().
Try this:
$ perl chm.pl
1017.4 chmods per sec

$file = "test.file";
chmod ( 0700, ($file) ) || die "chmod ( 0000, (\"$file\") ): $!";
-w $file || die "perl chmod will fail w/o write permission on $file\n";
$t = time;
while( $t == time ) {}
$t = time;
$secs = 5;
$stop = $t + $secs;
while( time < $stop ) {
  chmod (0777, ($file) ) == 1 or die "blah, $!";
  $n++;
}
print $n / $secs, " chmods per sec\n";
-w $file || die "test.file is not writeable: $!";

> -----Original Message-----
> From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com]On Behalf
> Of David E. Weekly
> Sent: Tuesday, July 16, 2002 2:58 AM
> To: cygwin
> Subject: Cygwin is SLOW.
> 
> 
> Modern cygwins seem to be very slow. "Modern" meaning built within the last
> 6 months or so, and "slow" means that many basic file operations, such as
> "chmod", seem to be >10x slower (measured, not exaggerating) than previous
> cygwins. This is creating a pretty tight situation at our company as we're
> having to rewrite scripts, etc, to work around this. The sample test script
> below should demonstrate the problem. With "old" cygwins I got nearly 1000
> chmod's second on my workstation. With "new" cygwins I get under a dozen.
> The comparison was done on the same machine, same filesystem (NTFS) with
> otherwise identical conditions.
> 
> Have others been running into this? We're seeing this on all the machines at
> our company, so I'm pretty convinced it's not just a localized wierdness or
> misconfiguration. We'd love to be using Cygwin, but we may have to bail if
> we can't get it to run acceptably fast.
> 
> -david
> 
> 
> =====================================
> 
> 
> chmod ( 000, "test.file" ) || die "chmod test.file: $!";
> -w "test.file" || die "cannot change test.file's permissions" $!";
> $t = time;
> while( $t == time ) {}
> $t = time;
> $secs = 5;
> $stop = $t + $secs;
> while( time < $stop ) {
>   system( "chmod 777 test.file" ) == 0 or die "blah, $!";
>   $n++;
> }
> print $n / $secs, " chmods per sec\n";
> -w "test.file" || die "test.file is not writeable: $!";
> 
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* RE: Cygwin is SLOW.
  2002-07-16  8:20 ` Bernard A Badger
@ 2002-07-16  8:31   ` Bernard A Badger
  2002-07-16  8:38   ` Joe Buehler
  2002-07-16 15:54   ` David E. Weekly
  2 siblings, 0 replies; 12+ messages in thread
From: Bernard A Badger @ 2002-07-16  8:31 UTC (permalink / raw)
  To: cygwin

Hmm.  My Perl book (TYP21days) says that chmod needs write permission on 
the ***file***, but I changed the script and it works anyway.
One last time, chm.pl:

$file = "test.file";
chmod ( 0000, ($file) ) || die "chmod ( 0000, (\"$file\") ): $!";
#-w $file || die "perl chmod will fail w/o write permission on $file\n";
$t = time;
while( $t == time ) {}
$t = time;
$secs = 5;
$stop = $t + $secs;
while( time < $stop ) {
  chmod (0777, ($file) ) == 1 or die "blah, $!";
  $n++;
}
print $n / $secs, " chmods per sec\n";
-w $file || die "test.file is not writeable: $!";


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: Cygwin is SLOW.
  2002-07-16  8:20 ` Bernard A Badger
  2002-07-16  8:31   ` Bernard A Badger
@ 2002-07-16  8:38   ` Joe Buehler
  2002-07-16  8:44     ` Bernard A Badger
  2002-07-16 15:54   ` David E. Weekly
  2 siblings, 1 reply; 12+ messages in thread
From: Joe Buehler @ 2002-07-16  8:38 UTC (permalink / raw)
  To: cygwin

Bernard A Badger wrote:

> So, chmod has to be searched for over my path, and ends up coming over the
> network.  No wonder it's slow.

That's a good point -- the value of PATH can cause poor performance on
UNIX machines.  Commands that are most frequently used should be in
directories at the beginning of PATH.

Joe Buehler




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* RE: Cygwin is SLOW.
  2002-07-16  8:38   ` Joe Buehler
@ 2002-07-16  8:44     ` Bernard A Badger
  0 siblings, 0 replies; 12+ messages in thread
From: Bernard A Badger @ 2002-07-16  8:44 UTC (permalink / raw)
  To: Joe Buehler, cygwin

> -----Original Message-----
> From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com]On Behalf
> Of Joe Buehler

> Bernard A Badger wrote:
> 
> > So, chmod has to be searched for over my path, and ends up coming over the
> > network.  No wonder it's slow.
> 
> That's a good point -- the value of PATH can cause poor performance on
> UNIX machines.  Commands that are most frequently used should be in
> directories at the beginning of PATH.
> 
> Joe Buehler

Yes, but...   Don't let speed override correctness.  This is particularly 
critical for Cygwin users since may override many windows functions.
I don't put D:\cygwin\bin in my windows path for that very reason.  If I do,
I usually add it at the end of the path, even though that's slower.  
I am primarily a Windows user, and I don't want to mess up my Windows 
programs and scripts.  If I need real Cygwin power, I use the bash shell
with a Cygwin-first path.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* RE: Cygwin is SLOW.
  2002-07-16  8:20 ` Bernard A Badger
  2002-07-16  8:31   ` Bernard A Badger
  2002-07-16  8:38   ` Joe Buehler
@ 2002-07-16 15:54   ` David E. Weekly
  2 siblings, 0 replies; 12+ messages in thread
From: David E. Weekly @ 2002-07-16 15:54 UTC (permalink / raw)
  To: Bernard A Badger, cygwin

Bernard,

> Next time, try pasting the _actual_ script that you're using.

Thank you very much for your patience and for running the script -- my
apologies for the poor attachment; I will take greater care next time
posting.

> You're script isn't just doing chmod, though, it's doing SYSTEM chmod.

I realize that. Locally we did the same thing that you did, namely to
replace the Perl system() calls with local Perl fs calls -- that sped things
up quite a bit.

While you tried out the script with an older Perl, we were using the exact
same Perl (ActivePerl build 517), but varying our version of Cygwin used.
Our scripts were all executing locally, from local executables, so it wasn't
a network issue, either.

> If you want it to run fast, avoid system().

Our conclusion as well, but an unfortunate one, given that the older Cygwins
(not the older Perls) seem to be a whole lot more efficient at system(). Did
this get moved from copy-on-write lazy-load to some sort of "copy all pages
before doing anything" kind of a model? It feels like a bug. I may try to
get around to it, but I felt it was my duty to bring this to the attention
of the Cygwin crowd, in case it was sufficiently obvious to someone.

Bernard, thank you again for your time, and double apologies for the poor
script attachment.

Yours,
 David E. Weekly
 Software Engineer
 There, Inc.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* RE: Cygwin is SLOW
  2002-07-17  3:09 ` BiDuS
@ 2002-07-17  7:18   ` Bernard A Badger
  0 siblings, 0 replies; 12+ messages in thread
From: Bernard A Badger @ 2002-07-17  7:18 UTC (permalink / raw)
  To: cygwin



> -----Original Message-----
> From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com]On Behalf
> Of BiDuS
> Sent: Wednesday, July 17, 2002 2:58 AM
> To: cygwin@cygwin.com
> Subject: RE: Cygwin is SLOW
>
>
> Ok, maybe my English was bad enough to confuse you about my question.
> I meant "why is there a so big difference between executing one script (say
> the fast one) on a distant file and on a local file ?",
> the path to chmod.exe being the same for both execution (am I wrong ?).
> I quoted my results and drop other stuff.

> >> I've tried both slow and fast perl scripts on my machine (AMD XP1700,
> W2K)
> >>
> >> If  test.file is on a local directory
> >>
> >> $ perl fastchm.pl
> >> 2923.6 chmods per sec
> >>
> >> if test.file is on a mounted directory (through a symlink)
> >>
> >> $ perl fastchm.pl
> >> 143 chmods per sec
> >>
> >> Could anyone explain the performance ratio for both scripts ???
>
> [SNIP]
Because it _is_ a distant file.
C'mon, do you expect the network to set-up a connection and check authentication
and modify the file and return the results as quickly as a local file?
If you question the particular ratio, 20:1, you need to know a _lot_ of
specifics
about your system, before you get anywhere close to an answer.
(Disk speed, disk block caching, controllers, latency, network protocol,
network file system.)

With a local file, the "file" modifications are probably being done in a
in-memory image.  It doesn't have to be synced to disk.
Over the network, you don't have access to that cache, and must re-connect.
Clever implementations of Network File Systems may be able to hide
much of this difference, by, say, distributing the whole file system,
but evidently Windows doesn't do whatever it takes.

One typical point of overhead for the network file system, is opening the file.
Even though you have "mapped" the drive, opening the file still requires network
access, because it may have changed since you last closed it.
NFS are usually optimized for file access, rather than directory access.
This can be a bottleneck for sysadmin type things where you manipulate a lot of
metadata.  But most customers are not sysadmins, they just want their flat files
and databases to run fast.  (Well, they complain more about them anyway.)
>
> >> I got a wider gap for small c program opening and closing about 650 files
> >> It takes 0.750 s for local files and about 2 s for distant files
> >> On the linux machine, it's just 0.1 s for distant files...
> >>
> >> Is the _open() routine guilty ?
> >> Is it linked to the unix AND dos path compatibility ?
> >> Anyone as a hint to speed this up ?
This just points up the fact that it's your network access, not Cygwin, that
is so slow.  Network file system optimization is, I suppose, Off Topic.

> I noticed you mentionned the influence of the PATH length upon the global
> performance
> and I keep invastigating... (path convertion routine)
The PATH should only affect the slowchm.pl, as fastchm.pl doesn't repeatedly
scan the PATH.  It's the system() or exec() call that requires looking up
"chmod" in the path.  "test.file" is only "looked up" in the local directory.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* RE: Cygwin is SLOW
  2002-07-16 13:39 ` Bernard A Badger
@ 2002-07-17  7:01   ` Tony Arnold
  0 siblings, 0 replies; 12+ messages in thread
From: Tony Arnold @ 2002-07-17  7:01 UTC (permalink / raw)
  To: cygwin

I've just tried Bernard's scripts on both Cygwin PERL and ActiveState
PERL. I'm running Windows XP on a Celeron 466MHz box with 256Mb memory.

Cygwin PERL

Here is the PERL version info:

This is perl, v5.6.1 built for cygwin-multi

And here is the output from the two scripts:

[506]zzalsaca@ACA-VNT$ ./fastchm.pl 
327.4 chmods per sec
[507]zzalsaca@ACA-VNT$ ./slowchm.pl 
18 chmods per sec


Activestate PERL (a rather old version, I realise!)

Here is the PERL version info:

This is perl, v5.6.0 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2000, Larry Wall

Binary build 618 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 21:03:54 Sep 13 2000

And here is the output from the two scripts:

C:\users\zzalsaca\tmp>perl fastchm.pl
1588 chmods per sec

C:\users\zzalsaca\tmp>perl slowchm.pl
6.4 chmods per sec

So Activestate seems to be much faster using its internal chmod
function, but much slower if invoking an external chmod command.

I should point out that the Cygwin version was run from within a bash
shell running under rxvt whereas the Activestate was running from a cmd
prompt window.

Hope this is of use. I'll let other interpret the results!

Regards,
Tony.

> -----Original Message-----
> From: cygwin-owner@cygwin.com 
> [mailto:cygwin-owner@cygwin.com] On Behalf Of Bernard A Badger
> Sent: 16 July 2002 19:45
> To: cygwin@cygwin.com
> Subject: RE: Cygwin is SLOW
> 
> 
> I thought this was already clear, but here goes:
> The slow script I wrote (modified) invoked the perl 
> "system()" function. The system function invokes the 
> "chmod.exe" PROGRAM. (BTW, system("string arg1 arg2") will 
> exec() the program directly, and not invoke a shell, because 
> it doesn't see any "shell metacharacters". Otherwise you've 
> got even more overhead because you have to invoke a shell (sh 
> or cmd.exe or command.com, it depends!) and pass the string to it.)
> 
> The perl function chmod(mode, @files) will change the mode on 
> a list of files. This is done using a system call, rather 
> than exec'ing a program. 
> Hence, it is much faster.
> 
> When perl system() exec's "chmod.exe", it first has to FIND 
> it. That is, it searches each directory in the PATH variable 
> until it finds chmod.exe (or .com, or .bat...). You could put 
> in an absolute path to save time there. My PATH, for example 
> has several Network mapped drives in it.  Very slow!
> 
> I don't happen to have a native Win32 Perl, e.g., ActiveState 
> Perl, installed here, so I did not make a comparison test.
> 
> To see if Cygwin is really "slow",
> someone with both kinds of perls should run the scripts.
> 
> > -----Original Message-----
> > From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com]On 
> > Behalf Of BiDuS
> > Sent: Tuesday, July 16, 2002 12:03 PM
> > To: cygwin@cygwin.com
> > Subject: RE: Cygwin is SLOW
> > 
> > 
> > I've tried both slow and fast perl scripts on my machine 
> (AMD XP1700, 
> > W2K)
> > 
> > If  test.file is on a local directory
> > 
> > $ perl slowchm.pl
> > 113.4 chmods per sec
> > $ perl fastchm.pl
> > 2923.6 chmods per sec
> > 
> > if test.file is on a mounted directory
> > 
> > $ perl slowchm.pl
> > 51.9 chmods per sec
> > $ perl fastchm.pl
> > 143 chmods per sec
> > 
> > Could anyone explain the performance ratio for both scripts ???
> > 
> > btw, on a "slow" linux p3-866
> > test.file being on a remote directory
> > $ perl slowchm.pl
> > 187.8 chmods per sec
> > $ perl fastchm.pl
> > 3096.8 chmods per sec
> > 
> > test.file being on a local directory
> > $ perl slowchm.pl
> > 181.7 chmods per sec
> > $ perl fastchm.pl
> > 263232.5 chmods per sec   (arf!)
> > 
> > I got a wider gap for small c program opening and closing about 650 
> > files It takes 0.750 s for local files and about 2 s for 
> distant files 
> > On the linux machine, it's just 0.1 s for distant files...
> > 
> > Is the _open() routine guilty ?
> > Is it linked to the unix AND dos path compatibility ?
> > Anyone as a hint to speed this up ?
> > 
> > 
> > --
> > Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> > Bug reporting:         http://cygwin.com/bugs.html
> > Documentation:         http://cygwin.com/docs.html
> > FAQ:                   http://cygwin.com/faq/
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 
> 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* RE: Cygwin is SLOW
       [not found] <1026851730.8871.ezmlm@cygwin.com>
@ 2002-07-17  3:09 ` BiDuS
  2002-07-17  7:18   ` Bernard A Badger
  0 siblings, 1 reply; 12+ messages in thread
From: BiDuS @ 2002-07-17  3:09 UTC (permalink / raw)
  To: cygwin

Ok, maybe my English was bad enough to confuse you about my question.
I meant "why is there a so big difference between executing one script (say
the fast one) on a distant file and on a local file ?",
the path to chmod.exe being the same for both execution (am I wrong ?).
I quoted my results and drop other stuff.

>> I've tried both slow and fast perl scripts on my machine (AMD XP1700,
W2K)
>>
>> If  test.file is on a local directory
>>
>> $ perl fastchm.pl
>> 2923.6 chmods per sec
>>
>> if test.file is on a mounted directory (through a symlink)
>>
>> $ perl fastchm.pl
>> 143 chmods per sec
>>
>> Could anyone explain the performance ratio for both scripts ???

[SNIP]

>> I got a wider gap for small c program opening and closing about 650 files
>> It takes 0.750 s for local files and about 2 s for distant files
>> On the linux machine, it's just 0.1 s for distant files...
>>
>> Is the _open() routine guilty ?
>> Is it linked to the unix AND dos path compatibility ?
>> Anyone as a hint to speed this up ?

I noticed you mentionned the influence of the PATH length upon the global
performance
and I keep invastigating... (path convertion routine)



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* RE: Cygwin is SLOW
  2002-07-16 11:42 BiDuS
@ 2002-07-16 13:39 ` Bernard A Badger
  2002-07-17  7:01   ` Tony Arnold
  0 siblings, 1 reply; 12+ messages in thread
From: Bernard A Badger @ 2002-07-16 13:39 UTC (permalink / raw)
  To: cygwin

I thought this was already clear, but here goes:
The slow script I wrote (modified) invoked the perl "system()" function.
The system function invokes the "chmod.exe" PROGRAM.
(BTW, system("string arg1 arg2") will exec() the program directly, and
not invoke a shell, because it doesn't see any "shell metacharacters".
Otherwise you've got even more overhead because you have to invoke a shell
(sh or cmd.exe or command.com, it depends!) and pass the string to it.)

The perl function chmod(mode, @files) will change the mode on a list of files.
This is done using a system call, rather than exec'ing a program. 
Hence, it is much faster.

When perl system() exec's "chmod.exe", it first has to FIND it.
That is, it searches each directory in the PATH variable until it finds
chmod.exe (or .com, or .bat...).
You could put in an absolute path to save time there.
My PATH, for example has several Network mapped drives in it.  Very slow!

I don't happen to have a native Win32 Perl, e.g., ActiveState Perl,
installed here, so I did not make a comparison test.

To see if Cygwin is really "slow",
someone with both kinds of perls should run the scripts.

> -----Original Message-----
> From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com]On Behalf
> Of BiDuS
> Sent: Tuesday, July 16, 2002 12:03 PM
> To: cygwin@cygwin.com
> Subject: RE: Cygwin is SLOW
> 
> 
> I've tried both slow and fast perl scripts on my machine (AMD XP1700, W2K)
> 
> If  test.file is on a local directory
> 
> $ perl slowchm.pl
> 113.4 chmods per sec
> $ perl fastchm.pl
> 2923.6 chmods per sec
> 
> if test.file is on a mounted directory
> 
> $ perl slowchm.pl
> 51.9 chmods per sec
> $ perl fastchm.pl
> 143 chmods per sec
> 
> Could anyone explain the performance ratio for both scripts ???
> 
> btw, on a "slow" linux p3-866
> test.file being on a remote directory
> $ perl slowchm.pl
> 187.8 chmods per sec
> $ perl fastchm.pl
> 3096.8 chmods per sec
> 
> test.file being on a local directory
> $ perl slowchm.pl
> 181.7 chmods per sec
> $ perl fastchm.pl
> 263232.5 chmods per sec   (arf!)
> 
> I got a wider gap for small c program opening and closing about 650 files
> It takes 0.750 s for local files and about 2 s for distant files
> On the linux machine, it's just 0.1 s for distant files...
> 
> Is the _open() routine guilty ?
> Is it linked to the unix AND dos path compatibility ?
> Anyone as a hint to speed this up ?
> 
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* RE: Cygwin is SLOW
@ 2002-07-16 11:42 BiDuS
  2002-07-16 13:39 ` Bernard A Badger
  0 siblings, 1 reply; 12+ messages in thread
From: BiDuS @ 2002-07-16 11:42 UTC (permalink / raw)
  To: cygwin

I've tried both slow and fast perl scripts on my machine (AMD XP1700, W2K)

If  test.file is on a local directory

$ perl slowchm.pl
113.4 chmods per sec
$ perl fastchm.pl
2923.6 chmods per sec

if test.file is on a mounted directory

$ perl slowchm.pl
51.9 chmods per sec
$ perl fastchm.pl
143 chmods per sec

Could anyone explain the performance ratio for both scripts ???

btw, on a "slow" linux p3-866
test.file being on a remote directory
$ perl slowchm.pl
187.8 chmods per sec
$ perl fastchm.pl
3096.8 chmods per sec

test.file being on a local directory
$ perl slowchm.pl
181.7 chmods per sec
$ perl fastchm.pl
263232.5 chmods per sec   (arf!)

I got a wider gap for small c program opening and closing about 650 files
It takes 0.750 s for local files and about 2 s for distant files
On the linux machine, it's just 0.1 s for distant files...

Is the _open() routine guilty ?
Is it linked to the unix AND dos path compatibility ?
Anyone as a hint to speed this up ?


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: Cygwin is SLOW.
@ 2002-07-16  3:48 John Vincent
  0 siblings, 0 replies; 12+ messages in thread
From: John Vincent @ 2002-07-16  3:48 UTC (permalink / raw)
  To: david; +Cc: cygwin

Hi David,

I think the cygwin developers have deliberately made new versions
of cygwin go slow because they're mean :-))

But seriously, I think if you want anyone to look at this, especially
as you seem to have a whole network of installed machines and users
in your company, you could take the time to find out what is taking
the extra time (at the source code level) and propose a solution, or
if you feel competent, supply a patch.

I'm not one of the cygwin developers, but I've been using cygwin, and
taking part in this list, for long enough to know that it basically
all works on good-will. The more good-will you show, and effort to
help you make, the more others will.

I'm sending this email to you with good-will and I hope that's how
you take it. My point is that simply saying "we've got a room full
of cygwin installations in our company and it's not good enough"
is not going to get the response you want.

Best Wishes,
/John Vincent.


>Modern cygwins seem to be very slow. "Modern" meaning built within the last
>6 months or so, and "slow" means that many basic file operations, such as
>"chmod", seem to be >10x slower (measured, not exaggerating) than previous
>cygwins. This is creating a pretty tight situation at our company as we're
>having to rewrite scripts, etc, to work around this. The sample test script
>below should demonstrate the problem. With "old" cygwins I got nearly 1000
>chmod's second on my workstation. With "new" cygwins I get under a dozen.
>The comparison was done on the same machine, same filesystem (NTFS) with
>otherwise identical conditions.
>
>Have others been running into this? We're seeing this on all the machines 
>at
>our company, so I'm pretty convinced it's not just a localized wierdness or
>misconfiguration. We'd love to be using Cygwin, but we may have to bail if
>we can't get it to run acceptably fast.
>
>-david



_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

end of thread, other threads:[~2002-07-17 13:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-16  3:25 Cygwin is SLOW David E. Weekly
2002-07-16  8:20 ` Bernard A Badger
2002-07-16  8:31   ` Bernard A Badger
2002-07-16  8:38   ` Joe Buehler
2002-07-16  8:44     ` Bernard A Badger
2002-07-16 15:54   ` David E. Weekly
2002-07-16  3:48 John Vincent
2002-07-16 11:42 BiDuS
2002-07-16 13:39 ` Bernard A Badger
2002-07-17  7:01   ` Tony Arnold
     [not found] <1026851730.8871.ezmlm@cygwin.com>
2002-07-17  3:09 ` BiDuS
2002-07-17  7:18   ` Bernard A Badger

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).