From 6af19bc98d34607d0d9a8e35c6c32df3973d736c Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Mon, 20 Jan 2025 11:24:19 +1100 Subject: [PATCH] Fix 3x slower major speed regression introduced in 98a9550260f7480d983a074812e600a8dfecd43f The commit that introduced the problem was trying to optimise rendering dense meshes with the opening decorator. However, it introduced more calculation in the initial project load and stored more data on every object. This resulted in models loading 3x slower for me which is pretty major. The original problem needs further investigation. --- src/bonsai/bonsai/tool/loader.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/bonsai/bonsai/tool/loader.py b/src/bonsai/bonsai/tool/loader.py index b558d75be5..bd699c4d5d 100644 --- a/src/bonsai/bonsai/tool/loader.py +++ b/src/bonsai/bonsai/tool/loader.py @@ -936,8 +936,7 @@ class Loader(bonsai.core.tool.Loader): # ios_edges holds true edges that aren't triangulated. # # we do `.tolist()` because Blender can't assign `np.int32` to it's custom attributes - ios_edges = list(set(tuple(e) for e in ifcopenshell.util.shape.get_edges(geometry).tolist())) - mesh["ios_edges"] = ios_edges + mesh["ios_edges"] = list(set(tuple(e) for e in ifcopenshell.util.shape.get_edges(geometry).tolist())) ios_item_ids = ifcopenshell.util.shape.get_faces_representation_item_ids(geometry).tolist() mesh["ios_item_ids"] = ios_item_ids @@ -981,11 +980,6 @@ class Loader(bonsai.core.tool.Loader): if rep.is_a("IfcShapeRepresentation"): tool.Loader.load_indexed_colour_map(rep, mesh) - ios_edges_values = [ - (e.vertices[0], e.vertices[1]) in ios_edges or (e.vertices[1], e.vertices[0]) in ios_edges - for e in mesh.edges - ] - tool.Blender.Attribute.fill_attribute(mesh, "ios_edges", "EDGE", "BOOLEAN", ios_edges_values) tool.Blender.Attribute.fill_attribute(mesh, "ios_item_ids", "FACE", "INT", ios_item_ids) tool.Blender.Attribute.fill_attribute(mesh, "ios_material_ids", "FACE", "INT", geometry.material_ids) else: