Blender Git Commit Log
Git Commits -> Revision 6ee2abd
Revision 6ee2abd by Jacques Lucke (master) November 21, 2021, 11:48 (GMT) |
Functions: use static names for multi-functions Previously, the function names were stored in `std::string` and were often created dynamically (especially when the function just output a constant). This resulted in a lot of overhead. Now the function name is just a `const char *` that should be statically allocated. This is good enough for the majority of cases. If a multi-function needs a more dynamic name, it can override the `MultiFunction::debug_name` method. In my test file with >400,000 simple math nodes, the execution time improves from 3s to 1s. |
Commit Details:
Full Hash: 6ee2abde82ef121cd6e927995053ac33afdbb438
Parent Commit: d455ead
Lines Changed: +74, -83
13 Modified Paths:
/source/blender/functions/FN_multi_function.hh (+2, -0) (Diff)
/source/blender/functions/FN_multi_function_builder.hh (+15, -19) (Diff)
/source/blender/functions/FN_multi_function_procedure_executor.hh (+1, -1) (Diff)
/source/blender/functions/FN_multi_function_signature.hh (+10, -3) (Diff)
/source/blender/functions/intern/field.cc (+3, -4) (Diff)
/source/blender/functions/intern/multi_function.cc (+5, -0) (Diff)
/source/blender/functions/intern/multi_function_builder.cc (+8, -28) (Diff)
/source/blender/functions/intern/multi_function_procedure.cc (+1, -1) (Diff)
/source/blender/functions/intern/multi_function_procedure_executor.cc (+2, -3) (Diff)
/source/blender/functions/tests/FN_multi_function_procedure_test.cc (+7, -7) (Diff)
/source/blender/nodes/intern/type_conversions.cc (+4, -4) (Diff)
/source/blender/nodes/shader/nodes/node_shader_math.cc (+4, -3) (Diff)
/source/blender/nodes/shader/nodes/node_shader_vector_math.cc (+12, -10) (Diff)
/source/blender/functions/FN_multi_function_builder.hh (+15, -19) (Diff)
/source/blender/functions/FN_multi_function_procedure_executor.hh (+1, -1) (Diff)
/source/blender/functions/FN_multi_function_signature.hh (+10, -3) (Diff)
/source/blender/functions/intern/field.cc (+3, -4) (Diff)
/source/blender/functions/intern/multi_function.cc (+5, -0) (Diff)
/source/blender/functions/intern/multi_function_builder.cc (+8, -28) (Diff)
/source/blender/functions/intern/multi_function_procedure.cc (+1, -1) (Diff)
/source/blender/functions/intern/multi_function_procedure_executor.cc (+2, -3) (Diff)
/source/blender/functions/tests/FN_multi_function_procedure_test.cc (+7, -7) (Diff)
/source/blender/nodes/intern/type_conversions.cc (+4, -4) (Diff)
/source/blender/nodes/shader/nodes/node_shader_math.cc (+4, -3) (Diff)
/source/blender/nodes/shader/nodes/node_shader_vector_math.cc (+12, -10) (Diff)