Page MenuHome

Geometry Nodes: Skip logging socket values for invisible node trees.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Dec 29 2022, 6:35 PM.

Details

Summary

Geometry nodes logs many socket values that the user can investigate in the node tree by hovering over sockets. Unfortunately, when there are lots of nodes, this can cause a lot of overhead (it's possible to create examples where the current logging mechanism takes up >70% of the total execution time. That's especially bad, because it is very unlikely that the user will look at these values generally.

This patch changes it so that only socket values are logged that correspond to sockets in node trees that are currently open in some node editor. This cuts down the number of logged values significantly, result in speedups and less memory consumption.

The downside is that when the user changes the visible node tree, it won't have any logged values until it is reevaluated. That seems like a good trade-off. I updated the tooltip message for that case to be a bit more precise. If user feedback suggests that this new behavior is too annoying, we can always add a UI option to log everything again. Probably shouldn't be added without actual need though as it is takes up space in the UI.

In this example, the execution time drops from ~300ms to ~100ms.

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Dec 29 2022, 6:35 PM
Jacques Lucke (JacquesLucke) created this revision.
Hans Goudey (HooglyBoogly) added inline comments.
source/blender/editors/space_node/node_draw.cc
1121–1122

How does this sound?

Unknown socket value. Either the socket was not used or its value was not logged during the last evaluation

Hans Goudey (HooglyBoogly) added inline comments.
source/blender/nodes/NOD_geometry_nodes_lazy_function.hh
76

Children context -> Child contexts

This revision is now accepted and ready to land.Dec 29 2022, 7:09 PM