Recently we came across IFC files with a lot of complex meshes. The performance was greatly reduced, and with profiling we were able to find one cause at the given location. It seems, the vector is reserved incrementally, which results unnecessary amount of relocation. Our fix was to iterate through the meshes and count the amount of elements and reserve the vector only once before insertations.
|
polyInput.m_poly_data->addFace(vecPointIndexes.begin(), vecPointIndexes.end()); |
Recently we came across IFC files with a lot of complex meshes. The performance was greatly reduced, and with profiling we were able to find one cause at the given location. It seems, the vector is reserved incrementally, which results unnecessary amount of relocation. Our fix was to iterate through the meshes and count the amount of elements and reserve the vector only once before insertations.
ifcplusplus/IfcPlusPlus/src/ifcpp/geometry/MeshOps.cpp
Line 3621 in 78f3824