I notice that when a node is outside of a group that it significantly increases render time, even if the logic inside of the group stops it being processed.
for example I have a light path node plugged into a group, inside the group it leads to another group which has a mix node to decide if the light path’s branch will be used based on a fac slider.
I notice if the fac is set to 0, bypassing the branch that leads to the light path node, that the render time is around 30% longer than if I put the light path node inside of the nested group (where it still isn’t called).
The problem is that if I have multiple branches that use the same light path output, then when more than one of them is in use I get a considerable performance increase from having one light path node outside of the groups, rather than having a light path node inside each group. I’m not sure why, as I believe cycles de-duplicates nodes at render time, and also loses the concept of groups.
Can anyone explain the reason for this? I’ve worked around it by having an additional mix node outside of the group to cancel the light path node before it even hits the outer group, but I’d be interested to understand the cause, so I might be able to optimise further.