delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/07/17/08:58:29

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Tony Arnold" <tony DOT arnold AT man DOT ac DOT uk>
To: <cygwin AT cygwin DOT com>
Subject: RE: Cygwin is SLOW
Date: Wed, 17 Jul 2002 13:56:11 +0100
Organization: University of Manchester
Message-ID: <31CB870AD5AA384BB5419025DD9F7A84104318@dailymail.cfs.ac.uk>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
Importance: Normal
In-Reply-To: <INEKLKBFCDBPKMKAJLMDMEABCGAA.bab@vx.com>
X-Authenticated-Sender: Anthony C Arnold from aca-vnt.mcc.ac.uk (acavnt) [130.88.201.150]
X-Authenticated-From: tony DOT arnold AT man DOT ac DOT uk

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 AT ACA-VNT$ ./fastchm.pl 
327.4 chmods per sec
[507]zzalsaca AT 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 AT cygwin DOT com 
> [mailto:cygwin-owner AT cygwin DOT com] On Behalf Of Bernard A Badger
> Sent: 16 July 2002 19:45
> To: cygwin AT cygwin DOT 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 AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com]On 
> > Behalf Of BiDuS
> > Sent: Tuesday, July 16, 2002 12:03 PM
> > To: cygwin AT cygwin DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019