Load big file with STEPControl_Reader cost too much time

I load my step code(400Mb) with the code:

STEPControl_Reader step_reader;
step_reader.ClearShapes();
IFSelect_ReturnStatus status = step_reader.ReadFile(argv[1]);

if (status != IFSelect_RetDone)
{
std::cout << "read" << argv[1] << "fail!" << std::endl;
return 1;
}

int num = step_reader.NbRootsForTransfer();
for (int i = 1; i <= num; i++) step_reader.TransferOneRoot(i);
TopoDS_Shapee = aShape = step_reader.Shape();

However, it cost 4mins for "ReadFile" , and 10mins for "TransferOneRoot".
I have no idea how can my code cost so much.

linbei jianbaoxia's picture

I run it in release, and it perform much better, it cost 57 seconds for "ReadFile" , and 44 seconds for "TransferOneRoot".

dannio wong's picture

Release perform much better

Кирилл Жильников's picture

Have a similar problem. I use STEPCAFControl_Reader::Perform() it takes 10 seconds to transfer data from a step file to a TDocStd_Document. Which is the best practice to display step models (as fast as possible)?

Dmitrii Pasukhin's picture

It is possible. See: 0032769: Data Exchange - Slow processing of very large STEP file - MantisBT (opencascade.org)

Compiline OCCT with new defined flag OCCT_MMGT_OPT_DEFAULT=1. You can do it with CMake.

Best regards, Dmitrii