CGAL / cgal

The public CGAL repository, see the README below
https://github.com/CGAL/cgal#readme
Other
4.93k stars 1.38k forks source link

CGAL Performance too slow (Skeletonize as example) #8506

Closed satabol closed 2 weeks ago

satabol commented 2 weeks ago

CGAL 6.0 (master, 2024.09.27), Windows 11, example cgal\Straight_skeleton_2\examples\Straight_skeleton_2

image

cgal docs: https://doc.cgal.org/latest/Straight_skeleton_2/index.html

Mesh and result: image

Visual Studio Profiler: image

in console it takes 23sec. image image result is good but it is too slow (((

Source data: SrcCoordsAndAngles.zip

extrude_skeleton.exe -i plane_skeleton_out.dat -a plane_skeleton_out.dat.angles

Question: Is a way to exceed performance to 100% on one core of CPU ? Or may be is a way to use multithreading?

satabol commented 2 weeks ago

I think I find out what the problem!

I build example by recipe in doc https://doc.cgal.org/latest/Manual/installation.html#ssec_installation_build_ex_demos: image

In another packages I used in my cases this is has no influence to performance. But now in Visual Studio Profiler was shown:

image

And after that moment I try to rebuild with Release mode and got excellent results: image It is more than x10 times! Super!!!

But... Is there any other way to speed up the performance?

afabri commented 2 weeks ago

Debug mode is for debugging purposes and not required to be fast. What do you want to achieve?

satabol commented 2 weeks ago

I want to do a preview in realtime on user mesh in Blender addon (free). 3D graphics computer are powerfull usually. Is Skeleton function multithreaded or a single threaded? Or is a way to use CUDA?

afabri commented 2 weeks ago

My question was what prevents you from running it in Release mode.

satabol commented 2 weeks ago

I can run in release mode. No problem. )))

afabri commented 2 weeks ago

The algorithm is inherently sequential. Let me close the issue.

satabol commented 2 weeks ago

Thank you.