bigarray#
- swordfish.function.bigarray()#
Big arrays are specially designed for advanced users in big data analysis. Regular arrays use continuous memory. If there is not enough continuous memory, an out of memory exception will occur. A big array consists of many small memory blocks instead of one large block of memory. Therefore big arrays help relieve the memory fragmentation issue. This, however, may come with light performance penalty for certain operations.
- Parameters:
dataType (Union[Alias[Literal["template"]], Constant]) – The data type for the big array.
initialSize (Constant, optional) – The initial size (in terms of the number of elements) of the big array, by default DFLT. If the first parameter is a data type, then initialSize is required; if the first parameter is an existing big array, then initialSize is optional.
capacity (Constant, optional) – The amount of memory (in terms of the number of elements) allocated to the big array, by default DFLT. When the number of elements exceeds capacity, the system will first allocate memory of 1.2~2 times of capacity, copy the data to the new memory space, and release the original memory.
defaultValue (Constant, optional) – The default value of the big array, by default DFLT. For many data types, the default values are 0. For string and symbol, the default values are null values.