Skip to content

Dyalog-8 Control Structures and Native Files: some Timings

Vector 12:4, page 56

performance data and files

Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 56

Summary

In a previous Vector ("Review of APL*PLUS III Control Structures", Vol.11 No.1 p.84) I celebrated the arrival of control structures in APL*PLUS as a generally good thing, and it is a delight to report that not only have Dyalog followed suit, but that they have faithfully copied the exact syntax of the Plus III model. The table below reruns in Dyalog-8 some timings I did to investigate the speed of iteration (as against each) in Plus III.

I have also done some rough timings on the new native file support, as I was interested to see whether it would be a worthwhile speed improvement for NewLeaf to spool pages "native" rather than buffering them in the workspace or using component files. The second table simulates a report of between 12 and 600 pages, each of 4567 bytes (this needs a 12Mb workspace to complete the times in column-1), and you can see that (a) native files a very fast indeed, and (b) turning off the ASCII translation makes almost no difference. All times were taken on a Dell P90 with a fast IDE hard disk.

Control Structures (vvv←5000⍴'fat' 'cat')
=========================================

                          APL*PLUS III       Dyalog/W Vn-8
                          ------------       -------------
         process¨vvv          0.33s              0.38s
         loopy vvv            0.49s              0.68s

Native Files (all times in ms)
==============================
Pages        PG←PG,pg      pg ⎕fappend 1       pg ⎕nappend ¯1
-----        --------      -------------        ASCII     raw
12                 42            521              220     212
40                234            800              330     315
100              1250           1615              673     570
200              6900           2840             1099     960
400             19000           5500             1854    1750
600             43000           7400             2691    2570

The file timings all involved creating a new file, appending each page to it, then erasing it. The times are marginally reduced if you tie and clear an existing file.