[Info-vax] READ and WRITE vs. SEARCH/OUTPUT

Arne Vajhøj arne at vajhoej.dk
Sat Jan 21 17:34:08 EST 2012


On 1/21/2012 5:32 PM, Arne Vajhøj wrote:
> On 1/21/2012 11:29 AM, Phillip Helbig---undress to reply wrote:
>> Imagine a file x.x like
>>
>> A
>> A
>> A
>> B
>> A
>> A
>> B
>> A
>> A
>> A
>> A
>> B
>>
>> Would SEARCH x.x B /OUT=X.LIS be better than
>>
>> $ OPEN/READ IN X.X
>> $ OPEN/WRITE OUT X.LIS
>> $LOOP:
>> $ READ/END=DONE IN REC
>> $ IF REC .EQS. "B" THEN WRITE OUT REC
>> $ GOTO LOOP
>> $DONE:
>> $ CLOSE IN
>> $ CLOSE OUT
>> $ EXIT
>>
>> Some tests indicate that SEARCH is much faster. Can one depend on this
>> always being the case?
>
> DCL is interpreted. SYS$SYSTEM:SEARCH.EXE is compiled code. It seems
> reasonable to expect that there exist a value N for which SEARCH is
> faster than DCL for files with >=N lines.

And N could be 1.

Depends on how the image activation overhead compares with
the speed of an iteration in DCL loop.

Arne




More information about the Info-vax mailing list