From 41eb33794ccd977582185159791805c84730a957 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Sun, 29 Aug 2021 22:12:53 -0500 Subject: Cleanup: Add comment about suspicious O(n^3) loop --- source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cube.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source') diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cube.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cube.cc index ccf7065f7b0..1de3942b462 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cube.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cube.cc @@ -90,6 +90,10 @@ static void calculate_vertices(const CuboidConfig &config, MutableSpan ve int vert_index = 0; + /* Though looping over all possible coordinates inside the cube only to skip them may be slow, + * the alternative is similar complexity to below in the poly index calculation. If this loop + * becomes a problem in the future it could be optimized, though only after proper performance + * testing. */ for (const int z : IndexRange(config.verts_z)) { for (const int y : IndexRange(config.verts_y)) { for (const int x : IndexRange(config.verts_x)) { -- cgit v1.2.3