OCC 6.3 vs. OCC 7.2 drastic drop in boolean op performance?

Hi,

after a quite long break I returned to OpenCascade, upgrading from version 6.3 to 7.2.

I noticed a significant drop in performance, given f.e. the following code:


const int ITERATIONS = 1000;

int main()
{
	const TopoDS_Shape result;
	BRepPrimAPI_MakeCylinder makeCylinder(10, 20);
	auto cylinder = makeCylinder.Shape();
	BRepBuilderAPI_MakeFace makeFace(gp_Pln(gp_Pnt(0,0,10),gp_Dir()));
	auto facePlane = makeFace.Face();

	// --> BENCHMARK START
	auto stopwatch = clock();
	
	for (auto i = 0; i < ITERATIONS; ++i)
	{
		auto operation = new BRepAlgoAPI_Common(cylinder, facePlane);
		operation->Build();

		delete operation;
	}

	stopwatch = clock() - stopwatch;
	// <-- BENCHMARK END

	printf("Duration: %f seconds.\n", (float)stopwatch / CLOCKS_PER_SEC);
	
    return 0;
}

On my machine (i7-4790) I have a run time of approx. 1.35 seconds for OCC 6.3, while 7.2 needs about 8.72 seconds.

I've used a plain 7.2 release build only using the required "freetype" component.

Any hints?

 

 

Forum supervisor's picture

Dear Christian,

Last years the Boolean Operations (BO) algorithms have been significantly improved and modified to properly process complex models. Implemented necessary model analysis and additional checks improve BO reliability and flexibility that requires correspondent extra resources. The algorithm provide several options to improve performance for real industrial models. For details, please see Release notes for OCCT last versions, documentation and publications on our Collaborative Development Portal.

Concerning your sample code, it is necessary to note that actually you perform BO twice, the first time is in the constructor of the class BRepAlgoAPI_Common, and the second time in explicitly called method Build().

In our tests of your 1000 operations case, the computation times for versions OCCT 6.3 and 7.2 are ~2 and ~4.4 seconds correspondingly.

In the tests for not so trivial shapes, BO 7.2 shows increased performance.

Please don’t hesitate to communicate us via Contact Form to exchange information about our services and general context and specific needs of your projects.

Best regards,

Forum supervisor