Page of SA21-9213-0
issued 15 September 1975
By TN L: SN21-0247
Storage Considerations
The following list shows how many bytes of storage are required for each data
type that can be in the active workspace:
Data Type Number of Bytes Required
Character constant or variable name 1 byte per character
Whole numbers that are equal to or
less than 231-1
4 bytes
Whole numbers that are greater than 8 bytes
231-1
Decimal numbers 8 bytes
Logical data 1/8 byte (1 byte can contain 8
ones or zeros)
Because the 5100 active workspace contains a fixed amount of storage, it is good
practice to conserve as much storage as possible. Following are some considera-
tions that can be used to conserve storage:
Make all objects (variables and user-defined functions) not required for use out-
side of a user-defined function local to the function.
0 Store data in data files on the tape, and use an APL shared variable (see
Chapter 8) to transfer the data into the active workspace when required.
Clear suspended functions (see Chapter 7) from the active workspace.
Group user-defined functions by related operations and store each group into
a workspace file on tape. Then when a certain group of related functions is
required to process data in the active workspace, the stored workspace contain-
ing these functions can be copied into the active workspace. When the pro-
cessing is done, the functions can be expunged (see Chapter 5) and another
group of functions (one workspace) can be copied into the active workspace.
0 If a value consists of all ones and zeros, store the value as logical data. For
example, you have the following vector:
v E: C r'C1 I4 f- 1. 0 I!> 2 ...' :I. >
v E: (:: 'r' I3 17
I. :I. I 3. :I. :I. 3. :I. 3.
The result is a vector of 10 ones, and each 1 requires four bytes of storage.
However, the vector can be changed to a logical vector as follows:
v E: c 'I' (:I 14 4- 1 A
v I:.:: C: *i' (:I r4
v E: I:: T (3 li
:I. 1. :I. 1. 1. I. I. :I. :I. :I.
The result looks just like the previous result; however, only 2 bytes of storage
was required.
'I
172
issued 15 September 1975
By TN L: SN21-0247
Storage Considerations
The following list shows how many bytes of storage are required for each data
type that can be in the active workspace:
Data Type Number of Bytes Required
Character constant or variable name 1 byte per character
Whole numbers that are equal to or
less than 231-1
4 bytes
Whole numbers that are greater than 8 bytes
231-1
Decimal numbers 8 bytes
Logical data 1/8 byte (1 byte can contain 8
ones or zeros)
Because the 5100 active workspace contains a fixed amount of storage, it is good
practice to conserve as much storage as possible. Following are some considera-
tions that can be used to conserve storage:
Make all objects (variables and user-defined functions) not required for use out-
side of a user-defined function local to the function.
0 Store data in data files on the tape, and use an APL shared variable (see
Chapter 8) to transfer the data into the active workspace when required.
Clear suspended functions (see Chapter 7) from the active workspace.
Group user-defined functions by related operations and store each group into
a workspace file on tape. Then when a certain group of related functions is
required to process data in the active workspace, the stored workspace contain-
ing these functions can be copied into the active workspace. When the pro-
cessing is done, the functions can be expunged (see Chapter 5) and another
group of functions (one workspace) can be copied into the active workspace.
0 If a value consists of all ones and zeros, store the value as logical data. For
example, you have the following vector:
v E: C r'C1 I4 f- 1. 0 I!> 2 ...' :I. >
v E: (:: 'r' I3 17
I. :I. I 3. :I. :I. 3. :I. 3.
The result is a vector of 10 ones, and each 1 requires four bytes of storage.
However, the vector can be changed to a logical vector as follows:
v E: c 'I' (:I 14 4- 1 A
v I:.:: C: *i' (:I r4
v E: I:: T (3 li
:I. 1. :I. 1. 1. I. I. :I. :I. :I.
The result looks just like the previous result; however, only 2 bytes of storage
was required.
'I
172