Load big file with STEPControl_Reader cost too much time

jianbaoxia

CAD community veteran
I load my step code(400Mb) with the code:
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".
And use the same file in Anaysis Situs, it just use 2mins, I have read the code with"load-step", I have no idea how can my code cost so much.
 

jianbaoxia

CAD community veteran
Are you sure not running it in debug mode in your code?
Oh, you are right, I run it in release, and it perform much better, it cost 57 seconds for "ReadFile" , and 44 seconds for "TransferOneRoot".
I think you was do something in this way in someone lesson, I just forget.
Your advice always inspires me a lot. Thank you for your generosity.
 
Top