IfcOpenShell is slow to open a large file

Created on 6 Sep 2019  Â·  5Comments  Â·  Source: IfcOpenShell/IfcOpenShell

When trying to do ifcopenshell.open('foo.ifc'), where foo.ifc is particularly large (say over 150MB), it takes a long time to load it, as well as perform operations like by_type().

Is there a faster approach? Can it be split and merged? Can it be processed line by line (but somehow retain relationships)?

I was attempting to purge all geometric data from a very large IFC file, but it is proving complex to maintain the correctness of the IFC relationships. (I did a basic approach just reading the file line by line and not doing any IfcOpenShell parsing, but just a bit of text manipulation, which gets close, but isn't guaranteed to maintain "correctness")

Most helpful comment

150 MB sounds quite small for a typical IFC file. I've successfully converted 1—2 GB files with IfcConvert and the file opening and parsing didn't take too much time, IIRC.

All 5 comments

What are the specifics? I think IfcOpenShell should be able to parse around 20mb/s on a modern system. by_type() should be instant as this is a mapping that maintained in the IfcFile class. It could be something specific to Python and printing data might be somewhat slow perhaps.

150 MB sounds quite small for a typical IFC file. I've successfully converted 1—2 GB files with IfcConvert and the file opening and parsing didn't take too much time, IIRC.

Interesting, I have run IfcOpenShell on Linux and indeed, it behaves as you describe.

The behaviour I experience is on a Windows computer where I compiled it myself. Perhaps I should try with the build bot binaries to see if that makes a difference.

When doing the final/release build, cmake.bat ... -DENABLE_BUILD_OPTIMIZATIONS=1 is highly recommended for better performance, I'm not sure does the build bot use this.

Closing issue as fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lorenzooliva picture lorenzooliva  Â·  6Comments

Moult picture Moult  Â·  12Comments

GiuMn picture GiuMn  Â·  6Comments

harrycollin picture harrycollin  Â·  12Comments

aahoo picture aahoo  Â·  9Comments