delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/10/23/07:45:51

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Sat, 23 Oct 2004 13:39:13 +0200
From: "Eli Zaretskii" <eliz AT gnu DOT org>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp AT delorie DOT com
Message-ID: <01c4b8f5$Blat.v2.2.2$1443c320@zahav.net.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 2.2.2
In-reply-to: <1k_dd.17187$nj.2376@newssvr13.news.prodigy.com>
(one2001boy AT yahoo DOT com)
Subject: Re: latest ls.exe version in XP problem
References: <6jKbd.13476$nj DOT 4016 AT newssvr13 DOT news DOT prodigy DOT com> <416fec3d AT news DOT upm DOT es> <EsSbd.30793$QJ3 DOT 6857 AT newssvr21 DOT news DOT prodigy DOT com> <01c4b377$Blat.v2.2.2$bd9427e0 AT zahav DOT net DOT il> <pSgcd.31525$QJ3 DOT 30700 AT newssvr21 DOT news DOT prodigy DOT com> <01c4b404$Blat.v2.2.2$848b3140 AT zahav DOT net DOT il> <qrKcd.15033$nj DOT 7239 AT newssvr13 DOT news DOT prodigy DOT com> <01c4b54b$Blat.v2.2.2$224c0ac0 AT zahav DOT net DOT il> <ZjFdd.16714$nj DOT 8541 AT newssvr13 DOT news DOT prodigy DOT com> <01c4b72e$Blat.v2.2.2$159b62a0 AT zahav DOT net DOT il> <1k_dd.17187$nj DOT 2376 AT newssvr13 DOT news DOT prodigy DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "one2001boy AT yahoo DOT com" <one2001boy AT yahoo DOT com>
> Date: Fri, 22 Oct 2004 02:33:33 GMT
> 
> under Windows XP in directory C:\windows\system32, I
> have 2558 File(s).
> 
> run ls -F, I wait for 16 seconds, and then screen start to display
> the files and directories.

Can you tell how much time it takes on the same machine, and in the
same directory, to run "ls" (without the -F option)?

The reason I'm asking this is because on XP, whenever any DOS program
is run, Windows needs to start a DOS emulation, load and process the
AUTOEXEC.NT file, and do other time-consuming chores.  That makes any
DJGPP program look generally sluggish on XP.

> The computer I am running is Pentium 4, 3.0 Ghz, with 512 Meg.

I tried this on a laptop with 993-MHz Pentium III and 256 MB of main
memory, running XP SP1a, and got the following responses: "ls -F"
starts displaying after 10 seconds when I run it on WINDOWS\SYSTEM32
directory first time, and after only 3 seconds when I run it on the
same directory afterwards (because the directory contents is already
in the Windows disk cache).  Just "ls" starts displaying after 1
second.  This system has 1844 files (including 41 subdirectories) in
its WINDOWS\SYSTEM32 directory.

The same "ls -F" command on a 450-MHz box running Windows 98 (1151
files in the WINDOWS\SYSTEM directory) takes 7 seconds.

So it sounds like the CPU speed is not important here.  What matters
is the file-system efficiency.

Also, the fact that "ls -F" takes a while in such a huge directory is
not really news to me.  We are lucky such directories are rare.

Bottom line, I suggest to use "ls --color" to find out file
attributes.  It is faster because it only looks at the files'
file-name extensions, but does not read the first few bytes to look
for the magic signature if the extension does not reveal the file's
type.  That will miss a few rare executable files if the LS_COLORS
variable doesn't catch them.

- Raw text -


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