not only [Sketch] - FC becomes unresponsive while performing calculations
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
not only [Sketch] - FC becomes unresponsive while performing calculations
Abdullah requested me to test the new sketch annotation hide/show feature with a real-life example. Here is one:
This is just an array of rectangles and I cannot work with this in practice since FC freezes quickly and then Windows steps in because FC is no longer responding. So I this topic affects not only sketcher but FC in general.
When you open the sketch and press the "Hide all" button, FC becomes immediately unresponsive. I see that only once CPU core is working on full duty while the RAM consumption does not increase.
Question one is, can you reproduce this also on Linux?
Next question: is there a way to distribute the CPU calculations to several CPU cores?
Third question only regarding sketcher: you proposed a way to have different annotation "virtual spaces", would this increase the performance?
Besides the annotation showing/hiding, I get the same immediate unresponsiveness when I change the dimensional constraint 468.
This is just an array of rectangles and I cannot work with this in practice since FC freezes quickly and then Windows steps in because FC is no longer responding. So I this topic affects not only sketcher but FC in general.
When you open the sketch and press the "Hide all" button, FC becomes immediately unresponsive. I see that only once CPU core is working on full duty while the RAM consumption does not increase.
Question one is, can you reproduce this also on Linux?
Next question: is there a way to distribute the CPU calculations to several CPU cores?
Third question only regarding sketcher: you proposed a way to have different annotation "virtual spaces", would this increase the performance?
Besides the annotation showing/hiding, I get the same immediate unresponsiveness when I change the dimensional constraint 468.
Re: not only [Sketch] - FC becomes unresponsive while performing calculations
Confirmed. One CPU core working. Had to kill FC.
Code: Select all
OS: Manjaro Linux (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.25844 (Git)
Build type: Release
Branch: master
Hash: 1b20118dfa3fb9f127f0e4fb122701f7fcdaa9fc
Python version: 3.9.7
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: French/France (fr_FR)
Re: not only [Sketch] - FC becomes unresponsive while performing calculations
Forgot to notify Adullah
abdullah wrote: .
Re: not only [Sketch] - FC becomes unresponsive while performing calculations
It takes the Sketcher around 7 minutes in my Debug version to hide around 700 constraints.
This is way much more than I expected.
The only way to know what is happening there is to profile it. I will try to do this in the following days.
It also took 50 seconds to run the QR Decomposition (Debug version). There are algorithms for QR decomposition using more than one core, but they are GPL (not LGPL). However, I doubt this is responsible for the 7 minutes.
Re: not only [Sketch] - FC becomes unresponsive while performing calculations
I had a quick look and suspected all the intermediate updating done at each value change to be responsible for the big delay.
Especially https://github.com/FreeCAD/FreeCAD/blob ... e.cpp#L794
I made a dirty test by commenting out the following lines :
https://github.com/FreeCAD/FreeCAD/blob ... t.cpp#L192
https://github.com/FreeCAD/FreeCAD/blob ... t.cpp#L194
After this moving the 700 constraints from one virtual space is a matter of seconds. Of course because of the dirty comments, a manual recompute is then needed, but it basically lasts the same time as opening the sketch for edition.
So I guess if we can block intermediate updating and do only a final one, this will go down from 7 minutes to something like 30 seconds (this is an order of magnitude, of course depends on your hardware and other things).
Re: not only [Sketch] - FC becomes unresponsive while performing calculations
It makes a lot of sense. This can easily be done by extending the command to update the virtual space to take an array of indices and overloading the corresponding function. Then the request should pass the list of indices and problem solved. I will do.
Thanks a lot!
Re: not only [Sketch] - FC becomes unresponsive while performing calculations
I had run out of time to think about a solution, but yours sounds very good to me.abdullah wrote: ↑Tue Sep 28, 2021 12:34 pm It makes a lot of sense. This can easily be done by extending the command to update the virtual space to take an array of indices and overloading the corresponding function. Then the request should pass the list of indices and problem solved. I will do.
Thanks a lot!
Re: not only [Sketch] - FC becomes unresponsive while performing calculations
That is the true meaning of collaboration...openBrain wrote: ↑Tue Sep 28, 2021 12:39 pmI had run out of time to think about a solution, but yours sounds very good to me.abdullah wrote: ↑Tue Sep 28, 2021 12:34 pm It makes a lot of sense. This can easily be done by extending the command to update the virtual space to take an array of indices and overloading the corresponding function. Then the request should pass the list of indices and problem solved. I will do.
Thanks a lot!
Re: not only [Sketch] - FC becomes unresponsive while performing calculations
git commit aa7d8001a238a0bc97acc74b055b4b26eed35f93