Mail Archives: djgpp/2004/10/23/07:45:51
> 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 -