Share event or value

I feel this is probably an old question, and something I should know, but here goes anyway.
What is the purpose of the share event and share value nodes?
Or put another way, what is the difference between using a share node rather than just multiple connections from the original node output.

The main difference is being able to easily swap out what gets shared if multiple nodes have the same source. For example; if you go directly from a point list to several generators, you’d have to reconnect everything if you wanted to scale the list (or do any other kind of operation on it).

A big improvement to it would of course being able to right-click an output port and insert a share node there, but now you’ll have to plan ahead if you use the same node as a source for different other nodes.

I often use the allow changes node instead of the share value node though, so that as well might be an option in some cases if the event stream isn’t needed for something downstream.

2 Likes

I appreciate the layout benefits, but there are no performance or risk differences?  

I’m not sure how it gets compiled, but in theory it shouldn’t be a matter of anything more than an additional variable code-wise. For instance, instead of

float source;
float result = source;

you’d get:

float source;
float share = source;
float result = share;

That’s basically it, yes. Somewhat more code gets generated, but it’s such a miniscule amount compared to the rest of the computations in a typical composition that it wouldn’t have any noticeable effect on performance.

Thanks … I was mostly just curious.