PERFORM

As the TCL statement executed by PERFORM runs in its own complete context, the overhead of executing the first perform at a context level is that of creating a new context that involves creating and initialising most of the Reality data structures, which is similar to logging on to the system. Subsequent PERFORMs also have an overhead due the information that needs to be passed between the context levels.

In addition to the performance overhead, the duplication of most of the data structures means that a process that uses just one level of PERFORM will utilise almost double the memory, and double the number of entries in the both the logon and additional workspace tables, of one that does not.

If the TCL statement being executed by the PERFORM is a DataBasic program, it is more efficient to turn it into a catalogued subroutine and call it using CALL ctlg-name.

CAPTURING NULL

If the terminal output of the PERFORM is to be neither displayed nor saved, use a CAPTURING NULL clause that throws away the output rather than CAPTURING var that stores the output in the workspace.

Nested PERFORMs

As each new PERFORM level creates a new context with the resultant performance and memory overheads, nested PERFORMs should always be avoided.