Quantcast
Channel: All LabVIEW posts
Viewing all articles
Browse latest Browse all 202873

Re: Benchmark for Insert Into Array vs Build Array

$
0
0

No one can accuse me of not RTFM.  It lures you right into using it to Append Arrays as if it would treat it as a special case.

 

Insert Into Array Function

Owning Palette:Array Functions

Requires: Base Package

...If you do not wire any index inputs, the function appends the new element or subarray to the end of the n-dim array....

 

What bugs me about this function is that it does too much work (except when prepending).  The memory management is suboptimal but probably still a bit of a holdover from the days of limited RAM.  Nonetheless, even if LV is a bit stingy when requesting buffer growth, there is still a linearly scaling amount of work being done every iteration.  It is consistent with moving every element every time.

 

Better than the alternative, but far, far from optimal.

 


Viewing all articles
Browse latest Browse all 202873

Trending Articles