Sluggish Spreadsheet on Complex Model?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
drmacro
Veteran
Posts: 8982
Joined: Sun Mar 02, 2014 4:35 pm

Re: Sluggish Spreadsheet on Complex Model?

Post by drmacro »

Works fine for me...but I've used the daily build of 0.19 for over a year now. :)

OS: Ubuntu 19.10 (XFCE/ubuntustudio)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: 6271887cc656d8571000de2f4e06df2be8d84105
Python version: 3.7.5
Qt version: 5.12.4
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
Roy_043
Veteran
Posts: 8550
Joined: Thu Dec 27, 2018 12:28 pm

Re: Sluggish Spreadsheet on Complex Model?

Post by Roy_043 »

User avatar
Jose Hidalgo
Posts: 124
Joined: Wed May 06, 2020 1:04 pm

Re: Sluggish Spreadsheet on Complex Model?

Post by Jose Hidalgo »

The tracker says performance improvements were introduced on Jan. 16, 2019: https://github.com/FreeCAD/FreeCAD/commit/e2dfd69968
So I suppose these improvements are present in my stable 0.19 version? Because more than 30 sec for every spreadsheet change is quite unusable.

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20943 (Git)
Build type: Release
Branch: master
Hash: ceb23799c76df3ebfa7be4b9fe83bb62de60bc6c
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: French/France (fr_FR)

BTW thanks for the related info. I know how to deactivate recomputing. Actually that's what I do right now every time I want to modify anything in my spreadsheet. Which honestly is quite a hassle, lol.
Merci à toutes les personnes qui m'ont aidé et m'aident encore à débuter et à m'améliorer sur FreeCAD
Dan-K
Posts: 35
Joined: Thu Sep 06, 2018 4:46 am

Re: Sluggish Spreadsheet on Complex Model?

Post by Dan-K »

Correct me if I'm wrong, but it feels like a full file recalculation occurs whenever a change is made to a spreadsheet (even if it's just a text change to a cell which isn't referenced anywhere else). At least that's what it feels like. Takes 20 seconds for each change for my current project and it's unbearable. Skipping calculation helps but makes it hard to work with the spreadsheet (changed cells are marked with #PENDING or show old changes until a recalculation is triggered).

I haven't looked too deeply at the code, but would it be possible to first check if an updated cell affects a formula and/or an alias and only kick off a full file recalculation at that point? We could build an index of each cell and alias used in any existing geometry's formula, or referenced by another cell to accomplish this (if not already implemented).

A next step could be to only recursively update affected geometry/cells referencing the changed cell? Perhaps doing something like building a quick tree via the lookup mentioned above, and only recalculating these items?
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: Sluggish Spreadsheet on Complex Model?

Post by chrisb »

Dan-K wrote: Sun May 09, 2021 5:29 am Correct me if I'm wrong, but it feels like a full file recalculation occurs whenever a change is made to a spreadsheet
Correct. The dependency is determined on the object level.
would it be possible to first check if an updated cell affects a formula and/or an alias and only kick off a full file recalculation at that point? We could build an index of each cell and alias used in any existing geometry's formula, or referenced by another cell to accomplish this (if not already implemented).

A next step could be to only recursively update affected geometry/cells referencing the changed cell? Perhaps doing something like building a quick tree via the lookup mentioned above, and only recalculating these items?
Of course this is possible. But it has to be done. And it probably means that the current recomputation mechanism, which is to used all over the place, cannot be used.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
papyblaise
Veteran
Posts: 8000
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: Sluggish Spreadsheet on Complex Model?

Post by papyblaise »

of course that is possible, you just have to check "Auto update"
the update will only be done if you check "Update" or close (validate) the operation
Attachments
mise a jour.PNG
mise a jour.PNG (19.66 KiB) Viewed 1065 times
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: Sluggish Spreadsheet on Complex Model?

Post by chrisb »

papyblaise wrote: Sun May 09, 2021 7:36 am you just have to check "Auto update"
You are right in Sketcher, but this topic is about Spreadsheet.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Dan-K
Posts: 35
Joined: Thu Sep 06, 2018 4:46 am

Re: Sluggish Spreadsheet on Complex Model?

Post by Dan-K »

Thanks for confirming @chrisb! I might take a crack at the solution I proposed above if I ever get time. Sounds like a fun project :)
User avatar
Jose Hidalgo
Posts: 124
Joined: Wed May 06, 2020 1:04 pm

Re: Sluggish Spreadsheet on Complex Model?

Post by Jose Hidalgo »

Dan-K wrote: Sun May 09, 2021 5:25 pm Thanks for confirming @chrisb! I might take a crack at the solution I proposed above if I ever get time. Sounds like a fun project :)
Thanks in advance Dan-K, and goold luck in that venture. I for one would certainly appreciate it.
Merci à toutes les personnes qui m'ont aidé et m'aident encore à débuter et à m'améliorer sur FreeCAD
lah
Posts: 40
Joined: Mon Nov 14, 2016 8:49 pm

Re: Sluggish Spreadsheet on Complex Model?

Post by lah »

Hello,

I have exact same issue. My model is becoming slower and slower, changing something in spreadsheet takes a while.
In my model something noticeable is that I'm intensively using :
  • variables defined in spreadsheets
    shapebinders
    linear repetition
    clones (to get exploded, assembled views)
It's not a huge model...
I'm wondering how can I do to speed up model. Maybe few changes are needed, maybe I need to redesign it. I need to do a V2 of this model but now I cannot continue like that. Before doing anything I'm trying to find best guidelines.

So I was wondering several things :
From
Dan-K wrote: ↑Sun May 09, 2021 7:29 am
Correct me if I'm wrong, but it feels like a full file recalculation occurs whenever a change is made to a spreadsheet
Correct. The dependency is determined on the object level.
Does it mean if 1 variable from spreadsheet is referenced by an object A, doing any changes in spreadsheet will recompute object A?
From what I see it can be only be better to split spreadsheet data into several spreedsheet to speed up model. It could give good results if variables defined in spreadsheet 1 are about object A, B and variables in spreadsheet 2 are about objects C, D. Practically, it seems difficult to do this effort.. often objects are dependent together, but in some cases it could help. What do your recommend? 1 spreadsheet for all document or several spreadsheets?
When you update your spreadsheet it triggers a recompute in FreeCAD. The longer this recompute takes the longer the lag will be. You can elect to skip recomputes (right click document name in the tree) in cases where you have multiple changes to make to your spreadsheet, and then re-enable afterwards to reduce the number of recomputes required.
Very useful trick when doing multiple changes.
Also it's interesting before after change we can see which objects need do be recomputed. So for example I have identified 3 objects that takes lot of time to recompute. I know they take some time to recompute, I have no idea why! Is there a place where I can find guidelines to speed up model?

About recalculation, from what I see, it can be disabled at global level, at techdraw level, not at part or body level. Why?

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22846 (Git)
Build type: Release
Branch: master
Hash: 1f46b72491a0008384a6db4f2615a656249f6f08
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: French/France (fr_FR)
Post Reply