From a812fe8ceb75fd2befe44a151f1e214f357c24c2 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Sun, 3 Oct 2021 16:05:19 +0200 Subject: Nodes: use extern templates for socket declarations The new socket declaration api generates a surprising amount of symbols in each translation unit where it is used. This resulted in a measurable compile time increase. This commit reduces the number of symbols that are generated in each translation unit significantly. For example, in `node_geo_distribute_points_on_faces.cc` the number of symbols decreased from 1930 to 1335. In my tests, this results in a 5-20% compile time speedup when this and similar files are compiled in isolation (measured by executing the command in `compile_commands.json`). Compiling the distribute points on faces node sped up from ~2.65s to ~2.4s. --- source/blender/nodes/NOD_node_declaration.hh | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/nodes/NOD_node_declaration.hh') diff --git a/source/blender/nodes/NOD_node_declaration.hh b/source/blender/nodes/NOD_node_declaration.hh index 5b8003a03de..aa01afc6a14 100644 --- a/source/blender/nodes/NOD_node_declaration.hh +++ b/source/blender/nodes/NOD_node_declaration.hh @@ -197,6 +197,7 @@ class SocketDeclarationBuilder : public BaseSocketDeclarationBuilder { { decl_->output_field_dependency_ = OutputFieldDependency::ForPartiallyDependentField( std::move(input_dependencies)); + return *(Self *)this; } }; -- cgit v1.2.3