Title: Slow Performance of IfcOpenShell Compared to XBim for Large IFC Files · Issue #6712 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Slow Performance of IfcOpenShell Compared to XBim for Large IFC Files · Issue #6712 · IfcOpenShell/IfcOpenShell
X Title: Slow Performance of IfcOpenShell Compared to XBim for Large IFC Files · Issue #6712 · IfcOpenShell/IfcOpenShell
Description: Bug Description I am encountering a significant performance issue with IfcOpenShell when processing IFC files, especially when compared to XBim. My program, written in C++ and using IfcOpenShell, runs much slower than XBim for files of v...
Open Graph Description: Bug Description I am encountering a significant performance issue with IfcOpenShell when processing IFC files, especially when compared to XBim. My program, written in C++ and using IfcOpenShell, r...
X Description: Bug Description I am encountering a significant performance issue with IfcOpenShell when processing IFC files, especially when compared to XBim. My program, written in C++ and using IfcOpenShell, r...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/6712
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Slow Performance of IfcOpenShell Compared to XBim for Large IFC Files","articleBody":"### Bug Description\n\nI am encountering a significant performance issue with IfcOpenShell when processing IFC files, especially when compared to XBim. My program, written in C++ and using IfcOpenShell, runs much slower than XBim for files of various sizes (12MB, 80MB, 200MB, and 700MB). Since both libraries utilize C++ and OpenCascade for geometry processing, I expected their performance to be more comparable, but IfcOpenShell consistently underperforms.\n\nHere’s how to reproduce the issue:\n\nCompile and run the provided C++ code with IfcOpenShell.\nUse an IFC file (e.g., \"D:/Trachhaha/Code/file200Mb.ifc\") as input.\nMeasure the time taken for file loading and the iteration process.\nPerformance Data:\n12MB: IfcOpenShell (222s) vs XBim (2s)\n80MB: IfcOpenShell (242s) vs XBim (3s)\n200MB: IfcOpenShell (70s) vs XBim (20s)\n700MB: IfcOpenShell (288s) vs XBim (46s)\nPerformance Breakdown:\nFor smaller files (12MB and 80MB), the while(iterator.next()) loop accounts for 98% of the total processing time.\nFor larger files (200MB and 700MB), the file opening process (IfcParse::IfcFile) takes up approximately 40% of the total time.\nAttempts at Optimization:\nI’ve explored several alternatives to improve performance, but none have been successful:\n\nCGAL: Encountered runtime errors.\ncgal-simple: Performance was similar to hybrid-cgal-simple-opencascade.\nOpenCascade alone: Ran extremely slowly, worse than IfcOpenShell.\nRequest for Help:\nI need assistance in optimizing IfcOpenShell to approach XBim’s performance levels. Specifically, I’d like guidance on:\n\nReducing the time spent in the while(iterator.next()) loop for smaller files.\nSpeeding up the file opening process for larger files.\nAny configuration tweaks, alternative approaches, or optimizations that could improve overall performance.\nSince XBim achieves much faster results using C++ and OpenCascade, I believe there’s potential for IfcOpenShell to improve in these areas. Please advise on how I can enhance the speed of my program.\n\n### Attachments\n\nhttps://drive.google.com/drive/folders/1gd1uKXPl_FYwQyrLma5j1y5sm46pO9Hf?usp=drive_link\n\n\n### Debug and Error Output\n\n```true\nint main() {\n auto start = std::chrono::high_resolution_clock::now();\n std::string filePath = \"D:/Trachhaha/Code/file200Mb.ifc\";\n IfcParse::IfcFile file(filePath);\n\n // Geometry processing settings\n ifcopenshell::geometry::Settings settings;\n settings.set(\"use-world-coords\", true); // Use global coordinates\n settings.set(\"weld-vertices\", false); // Preserve vertices for normals\n settings.set(\"apply-default-materials\", false); // No default materials needed\n settings.set(\"convert-back-units\", true); // Convert units back to IFC\n\n int num_threads = std::thread::hardware_concurrency();\n IfcGeom::Iterator iterator(\"hybrid-cgal-simple-opencascade\", settings, &file, num_threads);\n\n if (!iterator.initialize()) {\n std::cerr \u003c\u003c \"Failed to initialize iterator\" \u003c\u003c std::endl;\n return 0;\n }\n\n auto end0 = std::chrono::high_resolution_clock::now();\n std::chrono::duration\u003cdouble> elapsed1 = end0 - start;\n std::cout \u003c\u003c \"\\nTime1 (file loading): \" \u003c\u003c elapsed1.count() \u003c\u003c \" s \";\n\n auto start2 = std::chrono::high_resolution_clock::now();\n int count = 0;\n do {\n int progress = iterator.progress();\n if (progress % 5 == 0 && progress != count) {\n std::cout \u003c\u003c \"\\nProgress: \" \u003c\u003c progress;\n count = progress;\n }\n // Placeholder for handling instance and geometry data\n//struct ShapeGeometryData {\n//\tint label;\n//\tstd::vector\u003cdouble> vertices;\n//\tstd::vector\u003cdouble> normals;\n//\tstd::vector\u003cint> indices;\n//\tBoundingBox localBoundingBox;\n//};\n\n//struct ShapeInstanceData {\n//\tint InstanceLabel;\n//\tstd::string ExpressTypeId;\n//\tint IfcProductLabel;\n//\tint StyleLabel;\n//\tint ShapeGeometryLabel;\n//\tint RepresentationContext;\n//\tRepresentationType RepresentationType;\n//\tEigen::Matrix4d Transformation;\n//\tBoundingBox globalBoundingBox;\n//\tstd::string IfcType;\n//\tstd::string Guid;\n//};\n } while (iterator.next());\n\n auto end2 = std::chrono::high_resolution_clock::now();\n std::chrono::duration\u003cdouble> elapsed2 = end2 - start2;\n std::cout \u003c\u003c \"\\nTime2 (iteration): \" \u003c\u003c elapsed2.count() \u003c\u003c \" s \";\n std::chrono::duration\u003cdouble> elapsed3 = end2 - start;\n std::cout \u003c\u003c \"\\nTotal Time: \" \u003c\u003c elapsed3.count() \u003c\u003c \" s \";\n\n return 0;\n}\nAdditional Details:\nIfcOpenShell Version: [V0.8.0]\nOperating System: [Windows 10]\nCompiler: [Visua studio 2022]\nHardware: [Intel i7-11th, 32GB RAM]\n```","author":{"url":"https://github.com/trachhaha","@type":"Person","name":"trachhaha"},"datePublished":"2025-05-16T09:12:19Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/6712"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b48b7a87-67b4-e8ee-105b-2d53a1b22b9a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8DFE:19AD56:5AC5C1:794F0F:6B04BE61 |
| html-safe-nonce | 503a2c765845fd664f689d90eff6728b05f90158357596bdbc5ef9f993bf4850 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4REZFOjE5QUQ1Njo1QUM1QzE6Nzk0RjBGOjZCMDRCRTYxIiwidmlzaXRvcl9pZCI6Ijg1NzA2Njk2NDY4MzgyODM4NzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 272c1f612f1b9f54c3a41b2b5f3d52de576e7e99011a2b46f77dbc3c7bc3dcbb |
| hovercard-subject-tag | issue:3068434895 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IfcOpenShell/IfcOpenShell/6712/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8b8b91dde6593d562e1a4393a3c192335201998b321d22121f30b5ee2b3fdb79/IfcOpenShell/IfcOpenShell/issues/6712 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8b8b91dde6593d562e1a4393a3c192335201998b321d22121f30b5ee2b3fdb79/IfcOpenShell/IfcOpenShell/issues/6712 |
| og:image:alt | Bug Description I am encountering a significant performance issue with IfcOpenShell when processing IFC files, especially when compared to XBim. My program, written in C++ and using IfcOpenShell, r... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | trachhaha |
| hostname | github.com |
| expected-hostname | github.com |
| None | 85dd75377eb77313206b8fc108bcee6a3a029286d94bf32bf9b4426e4d92e0c4 |
| turbo-cache-control | no-preview |
| go-import | github.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git |
| octolytics-dimension-user_id | 13692563 |
| octolytics-dimension-user_login | IfcOpenShell |
| octolytics-dimension-repository_id | 40473201 |
| octolytics-dimension-repository_nwo | IfcOpenShell/IfcOpenShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 40473201 |
| octolytics-dimension-repository_network_root_nwo | IfcOpenShell/IfcOpenShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0d64fa748a2bab9a5b587a967ac4da1cfa8da6dd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width