Subj : sweep
To   : Eddy Thilleman
From : Vitus Jensen
Date : Tue Mar 13 2001 06:18 pm

Moin Eddy!

10.03.2001, Eddy Thilleman wrote a message to Vitus Jensen:

ET>>> I've written a sweep command in pascal and compiled it with
ET>>> Borland Pascal as DOS .EXE file and compiled it with Virtual
ET>>> Pascal/2 v2.1 build 243 as OS/2 .EXE file, and implemented it
ET>>> also in REXX.
...
ET> another example

ET> sweep for %a in (*.bak) do echo %a

ET> The compiled version is easier to use than the REXX variant.

"easier to use"?  I would expect the rexx variant to be easier to code.


...
ET>>> Shall I post the source of all three?
VJ>> Are you sure it's the screen output?
ET> No, I'm not certain.
VJ>> If not, remove screen output from the program and rerun it.

ET> I've run it without screen output from all the sweep variants
ET> themselves, the only screen output is by the command run in each
ET> (sub)directory. The command in the compiled OS/2 version is run
ET> somewhat slower.

There are larger gaps between execution in the different directories?  That
would mean that searching for directories is slower in VP/2 (how do you do
it?), which is not to be expected or the startup of every command line takes
longer (s.b.).


VJ>> If you know the offending part in the OS/2 EXE it may be an idea to
VJ>> post that part.
ET> I don't know what the cause is. My best guess is that the loading and
ET> initializing of cmd.exe takes more time than command.com. Cmd.exe and
ET> command.com are located on the same partition. In a few days (I don't
ET> have the time at the moment), I'll put a copy of cmd.exe on a ramdisk
ET> and modify the sweep pascal source code to start the cmd.exe file on
ET> the ramdisk, to see if that cuts down the difference.

cmd.exe should already reside in the disk cache so the difference should be
small or non existent.

You are executing all commands through cmd.exe when coding in pascal. How do
you do it in Rexx?  If you just let the already running copy of cmd.exe handle
it we have a major difference: a new process for cmd.exe does not have to be
started.
Try to compare the following times,

Rexx:        sweep cmd /C "for %a in (*.bak) do echo %a"
Pascal:      sweep for %a in (*.bak) do echo %a


Bye,
  Vitus

---
* Origin: REALITY.SYS Corrupted: Re-boot universe? (Y/N/Q) (2:2474/424.1)