#619 Made TreeView stable

Merged, abandoned or rejected pull requests are moved here to clear the main Pull Requests forum.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: #619 Made TreeView stable

Post by realthunder »

wmayer wrote:Today I found a major performance regression with the new tree view. In issue #1999 you will find the file FreeCadProblem.step which takes 15 minutes to load in release mode.
Mantis is down at the moment. Could you please post the step file here, or if it is too big, send it to my email?
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: #619 Made TreeView stable

Post by wmayer »

Here it is.
Attachments
FreeCadProblem.7z
(182.53 KiB) Downloaded 74 times
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: #619 Made TreeView stable

Post by realthunder »

wmayer wrote:Here it is.
It is because of the cyclic check on adding object. This is the worst case I've predicated, all children first. But obviously I am wrong about the performance impact. Only 900 object, and it's that slow. I've submitted the fix.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: #619 Made TreeView stable

Post by wmayer »

Thanks for looking at this issue. Unfortunately your patch doesn't change anything. The load time of the STEP file is still at ~15 minutes.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: #619 Made TreeView stable

Post by realthunder »

wmayer wrote:Thanks for looking at this issue. Unfortunately your patch doesn't change anything. The load time of the STEP file is still at ~15 minutes.
That's odd. You're right, it didn't make a difference, because I reverted the change and it is still fast on my machine! How did you load the file, by just opening it using FC?
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: #619 Made TreeView stable

Post by realthunder »

Even debug build is fast. What OS are you using?
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: #619 Made TreeView stable

Post by wmayer »

By drag'n'drop into the FreeCAD main window. Reading and transferring the STEP is fast (which isn't influenced by the tree) but when adding the part objects to the part container then this step is very slow (something like O(n^2) I guess).

IMO, the problem is inside DocumentItem::populateItem where you first remove all children of an item and then add them again step-by-step. And this is also done when any kind of property has been changed -- not only link properties. This makes it somewhat inefficient and would explain the quadratic runtime.

Btw,
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10680 +1 (Git)
Build type: Release
Branch: pr670
Hash: 802c3480fbbc6445331511633ae8ab8fd52413e8
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: #619 Made TreeView stable

Post by DeepSOIC »

I have tried opening the step in:
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10665 (Git)
Build type: Release
Branch: master
Hash: 47847513a85ff6615774ef628230f79e37471daf
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0

First time, progress bar filled quite quickly, but then it started from beginning, and looked like stuck for about a minute. Then I just killed FreeCAD.

I opened the step by double-clicking file (i.e., like through command line FreeCAD path\to\file.step).
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: #619 Made TreeView stable

Post by realthunder »

wmayer wrote:By drag'n'drop into the FreeCAD main window. Reading and transferring the STEP is fast (which isn't influenced by the tree) but when adding the part objects to the part container then this step is very slow (something like O(n^2) I guess).
I just drag and drop, and it is fast. In Debug mode, it took less than 20 second on my machine. So it is a Windows issue, that will be very unexpected if so. I'll try and see.
DeepSOIC wrote:First time, progress bar filled quite quickly, but then it started from beginning, and looked like stuck for about a minute. Then I just killed FreeCAD
Yes, it is a two stage thing. The second stage locks the GUI, and took about 20 seconds on my machine.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: #619 Made TreeView stable

Post by realthunder »

Yep, it is happening on my Windows, too. Six minutes now, still no response. Ahh...I hate Windows. It's probably Qt's fault though. I'll try to avoid take all children and see.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
Post Reply