diff options
author | Jacques Lucke <jacques@blender.org> | 2022-09-17 13:08:43 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-09-17 13:08:57 +0300 |
commit | 7549e0c5ae36be739f0e0a38e87eb85428808e89 (patch) | |
tree | d931c76b0001cfc5bea7ac3f29287d91713ef5ac /source/blender/nodes/intern/geometry_nodes_lazy_function.cc | |
parent | 1810b1e4c88191e3578518e12f9f3d318e08dc60 (diff) |
Geometry Nodes: use stringref instead of string in logger
This reduces logging overhead. The performance difference is only
significant when there are many fast nodes. In my test file with many
math nodes, the performance improved from 720ms to 630ms.
Diffstat (limited to 'source/blender/nodes/intern/geometry_nodes_lazy_function.cc')
-rw-r--r-- | source/blender/nodes/intern/geometry_nodes_lazy_function.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/nodes/intern/geometry_nodes_lazy_function.cc b/source/blender/nodes/intern/geometry_nodes_lazy_function.cc index 137057414d4..996cea26718 100644 --- a/source/blender/nodes/intern/geometry_nodes_lazy_function.cc +++ b/source/blender/nodes/intern/geometry_nodes_lazy_function.cc @@ -134,7 +134,8 @@ class LazyFunctionForGeometryNode : public LazyFunction { if (geo_eval_log::GeoModifierLog *modifier_log = user_data->modifier_data->eval_log) { geo_eval_log::GeoTreeLogger &tree_logger = modifier_log->get_local_tree_logger( *user_data->compute_context); - tree_logger.node_execution_times.append({node_.name, start_time, end_time}); + tree_logger.node_execution_times.append( + {tree_logger.allocator->copy_string(node_.name), start_time, end_time}); } } }; |