(code sync-ed from github master yesterday)
Code: Select all
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.0.31333 (Git)
Build type: Release
Branch: master
Hash: 3a4d2399d0facaee1516212b1df9e9b97dd8f3a0
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/Australia (en_AU)
Installed mods:
* CurvedShapes 1.0.4
* freecad.gears 1.0.0
* lattice2 1.0.0
* sheetmetal 0.2.59
- Win/Visual Studio Community 2022 - set the FreeCADCmd as the startup project. Build the "Release" configuration.
- add the attached "solverLoad.py" as a cmdline arg for the "Debug settings" of the project
- go to menu "Debug/Performace profiler..." (Alt-F2), pick the "CPU" metric and hit the "Start" button at the bottom
- takes about 4-5 minutes to get the report (I used a laptop with AMD Ryzen 5 3500U 2.10 GHz, 16 GB RAM)
- once the execution is finished and you get the report, click the "Open details" link (under the plot) and set the current view to "Module".
My report shows something like this: The script creates a sketch with 137 elements (an ellipse and LineSegs for the rest) and 400-ish constraints - about 40 are redundant (constructing a tangent just to construct the normal on its base rather than straight in the ellipse, but I wanted as many constraints as possible with little imagination and coding effort). Once constructed, one of the primary driving constraints (the angle of the ellipse's major axis with the X one) is modified, just to make sure I'm kicking the solver into action on the entire set of constraints.
To me, that's mind-boggling. I mean, 137 elements represent some 500+ DOFS.
I was expecting that solving such a big multi-dim equation within so many constraints to eat most of the CPU. But... surprise...
Why, oh, why? Have I done something wrong and didn't hit the solver as hard as I imagined? Is there an issue with the design/impl of the Sketcher?