Pocket operation performance
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Pocket operation performance
I was trying to pocket and the dialog was very slow to come up. I did some profiling on it and all the time is spent in checking if a point is inside the shape in _getDirectedNormal in PathPocketShape.py. This is called by getWire. From testing with a few different settings and different shapes getWire has always returned None. Is getWire not functioning as intended? Or am I not using the correct settings to create an extension wire? If the default settings usually return None, can we disable this check by default? There were roughly 400 edges in the faces I was trying to pocket, isInside is called twice per edge, and takes .15 seconds on my machine, so over 2 minutes. I changed _getDirectedNormal to just return None and it finishes almost instantly with the same results.
OS: Arch Linux (kde//usr/share/xsessions/i3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22198 (Git)
Build type: Release
Branch: master
Hash: 76e74294894bbce46d006e149315c6274d206278
Python version: 3.8.5
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
OS: Arch Linux (kde//usr/share/xsessions/i3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22198 (Git)
Build type: Release
Branch: master
Hash: 76e74294894bbce46d006e149315c6274d206278
Python version: 3.8.5
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
Re: Pocket operation performance
Hi etrombly. Thanks for taking the effort to dig into these issues of sluggish performance. Sadly, I cannot answer any of your very good questions. It's a shame that after 170 views , not one person has been able to reply.
Can you briefly outline how you are profiling this. It seems little attention has been given to avoiding performance and memory issues and that would be worth looking into.
Can you briefly outline how you are profiling this. It seems little attention has been given to avoiding performance and memory issues and that would be worth looking into.
Re: Pocket operation performance
One of the contributors of that file may know:
mlampert wrote: pinged by pinger macro
Russ4262 wrote: pinged by pinger macro
sliptonic wrote: pinged by pinger macro
Who is Schildkroet?luzpaz wrote:Kunda1, are you luzpaz?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Pocket operation performance
Wsk8 wrote:Are you Schildkroet?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Pocket operation performance
Yes.luzpaz wrote:Kunda1, are you luzpaz?
Link to file would be nice
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Pocket operation performance
Sorry, I must have searched the wrong file in my previous posts. Authors of https://github.com/FreeCAD/FreeCAD/blob ... hapeGui.py are
mlampert
sliptonic
(etromply)
mlampert
sliptonic
(etromply)
dubstar-04 wrote:dubstar-04
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Pocket operation performance
I've been using a combination of PathLog.warning for print debugging and my instructions here https://forum.freecadweb.org/viewtopic.php?f=10&t=44785 for performance analysis.
The main issue is in this file https://github.com/FreeCAD/FreeCAD/blob ... etShape.py In the _getDirectedNormal function which is called by _getDirection and getWire. It seems like neither _getDirection or getWire ever return an actual wire from the limited testing I did.
The main issue is in this file https://github.com/FreeCAD/FreeCAD/blob ... etShape.py In the _getDirectedNormal function which is called by _getDirection and getWire. It seems like neither _getDirection or getWire ever return an actual wire from the limited testing I did.
Re: Pocket operation performance
Here's the file I was testing. Just double click on Pocket_Shape to bring up the pocket dialog, it takes about 2 minutes on my computer. If you edit PathPocketShape.py and under def _getDirectedNormal(self, p0, normal): add "return None", it will open pretty much instantly. I'm just trying to figure out if there is a way we can disable that check by default unless it's needed. The code isn't really commented, so I was trying to figure out when getDirectedNormal would actually return something, because it returned None anyway in all my testing (which was just a few shapes and settings, not totally extensive).
https://filebin.net/1ovzn6i4s9q1aev3/Be ... t=lyo4tyln
https://filebin.net/1ovzn6i4s9q1aev3/Be ... t=lyo4tyln
Re: Pocket operation performance
I can verify that it took a couple of minutes to open, and it was more or less instant when the "normal" checking was bypassed. I have no idea what is happening or why it works that way.
Thanks for the file.
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22261 (Git)
Build type: Release
Branch: master
Hash: 1c432fd6170b7904592a224194e42d3c566707a6
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
Gene
Thanks for the file.
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22261 (Git)
Build type: Release
Branch: master
Hash: 1c432fd6170b7904592a224194e42d3c566707a6
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
Gene