Allow concatenated hosts/universes input Sequences in a VL.IO.ArtNet Send (Multiple) node

Hello,

So I made the switch a few days ago to the new ArtNet 2.*.* nodes, and it does show a maaaassive perfs improvement when sending out a lot of universes (approx 4 times faster in my stress-test patch!).
Bravo and thanks!

One comment though: what I think remains a bit of a pain is that, when dealing with multiple universes, (at least in my personal workflow) I usually end up with my ArtNet data as one big concatenated MutableArray or SpreadBuilder, and grouping it back to chunks of 512, while pretty straighforward, adds up pretty decently heavy when you hit hundreds of universes or more.

(See my test patch below with the comparison of different methods in search for efficiency, the best so far being using (System.Array) Copy from mscorlib, thanks to the suggestion from @tonfilm)

xp-ArtNet-send_20240424.vl (68.6 KB)

Wouldn’t it be more efficient to have an alternative Send (Multiple) node that would accept a Spread<String> for hosts, Spread<Integer32> for universe indices, and keep the existing Sequence<Float> input but that would be expected as a concatenated sequence, of length = universe count * 512?

That would dodge the need to nest individual Send nodes inside a ForEach loop, and above all the 512-slicing step, as I guess it could internally just offset/sample the appropriate 512 chunk inside the big concatenated input sequence without other intermediary copy.

What do you think?
T

3 Likes

my other suggestion would be to have a sender that has an offset + count input. it would allow to manage one big array of values and then tell the sender which values to send from this array.

the main problem right now is the need always to copy; all naive implementations will allocate new memory for the copy. having to do this every frame is a big burden for the garbage collector.

1 Like

version 2.1.2 of the pack comes with a new help patch “HowTo Send ArtNet from a large collection to multiple Universes”. it shows an allocation free way of slicing the data into the Send node by going via a MutableArraySegment. hope this helps?

4 Likes

Thanks for the pointers, I checked the said patch and this method is a massive perf improvement 🙏