Download G Programming Reference Manual

Transcript
Chapter 28
Performance Issues
is a scalar. In the case of an array of scalars, the following code shows what
you do to increment a value in an array.
This is quite efficient because it is not necessary to generate extra copies of
the overall array. Also, the element produced by the Index Array function
is a scalar, which can be created and manipulated efficiently.
The same is true of an array of clusters, assuming the cluster contains only
scalars. In the following diagram, manipulation of elements becomes a
little more complicated, because you now must use Unbundle and Bundle.
However, because the cluster is probably small (scalars use very little
memory), there is no significant overhead involved in accessing the
cluster elements and replacing the elements back into the original cluster.
If you have an array of clusters where each cluster contains large sub-arrays
or strings, indexing and changing the values of elements in the cluster can
be more expensive in terms of memory and speed.
G Programming Reference Manual
28-30
© National Instruments Corporation