Pointer array: Difference between revisions

Jump to navigation Jump to search
31 bytes added ,  15:02, 30 April 2020
m
Nested array model category
m (Kinds of array category)
m (Nested array model category)
 
Line 2: Line 2:


Pointer arrays take more space to store than flat arrays and are often slower to manipulate. The size of each pointer is the processor's [[wikipedia:Word_(computer_architecture)|machine word]] size—64 bits on a 64-bit machine. However, each element of a pointer array is itself an array, and is stored with an array header which may be several times the size of a pointer. When a simple array is converted to a pointer array, for instance, by appending a non-simple array as an element, the space used may be tens or even hundreds of times larger than it was before. If the type of the original array elements was smaller (in bits) than a pointer, [[structural function]]s on the array will be slower. Even if the original type was large, functions that need to read elements of the array, such as [[scalar function]]s, will be many times slower because of the need to follow a pointer to read every element.
Pointer arrays take more space to store than flat arrays and are often slower to manipulate. The size of each pointer is the processor's [[wikipedia:Word_(computer_architecture)|machine word]] size—64 bits on a 64-bit machine. However, each element of a pointer array is itself an array, and is stored with an array header which may be several times the size of a pointer. When a simple array is converted to a pointer array, for instance, by appending a non-simple array as an element, the space used may be tens or even hundreds of times larger than it was before. If the type of the original array elements was smaller (in bits) than a pointer, [[structural function]]s on the array will be slower. Even if the original type was large, functions that need to read elements of the array, such as [[scalar function]]s, will be many times slower because of the need to follow a pointer to read every element.
{{APL features}}[[Category:Kinds of array]]
{{APL features}}[[Category:Kinds of array]][[Category:Nested array model]]

Navigation menu