Blender Git Commit Log

Git Commits -> Revision 01b6c4b

Revision 01b6c4b by Jacques Lucke (master)
March 22, 2021, 11:01 (GMT)
Functions: make multi functions smaller and cheaper to construct in many cases

Previously, the signature of a `MultiFunction` was always embedded into the function.
There are two issues with that. First, `MFSignature` is relatively large, because it contains
multiple strings and vectors. Secondly, constructing it can add overhead that should not
be necessary, because often the same signature can be reused.

The solution is to only keep a pointer to a signature in `MultiFunction` that is set during
construction. Child classes are responsible for making sure that the signature lives
long enough. In most cases, the signature is either embedded into the child class or
it is allocated statically (and is only created once).

Commit Details:

Full Hash: 01b6c4b32bf0aa3f2add0d4d51de9f777cf5c51c
Parent Commit: ccb372d
Lines Changed: +224, -67

16 Modified Paths:

/source/blender/functions/FN_multi_function.hh (+17, -11) (Diff)
/source/blender/functions/FN_multi_function_builder.hh (+35, -7) (Diff)
/source/blender/functions/FN_multi_function_network_evaluation.hh (+1, -0) (Diff)
/source/blender/functions/FN_multi_function_signature.hh (+21, -18) (Diff)
/source/blender/functions/intern/multi_function.cc (+8, -1) (Diff)
/source/blender/functions/intern/multi_function_builder.cc (+9, -3) (Diff)
/source/blender/functions/intern/multi_function_network_evaluation.cc (+4, -1) (Diff)
/source/blender/functions/tests/FN_multi_function_network_test.cc (+34, -6) (Diff)
/source/blender/functions/tests/FN_multi_function_test.cc (+39, -13) (Diff)
/source/blender/nodes/function/nodes/node_fn_object_transforms.cc (+8, -1) (Diff)
/source/blender/nodes/function/nodes/node_fn_random_float.cc (+8, -1) (Diff)
/source/blender/nodes/intern/node_socket.cc (+8, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_map_range.cc (+8, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.cc (+8, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_sepcombXYZ.cc (+8, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_valToRgb.cc (+8, -1) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021