Lazy loading of python modules
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Lazy loading of python modules
Copying to Ext works for the build, need to check the right path for install. Modified most of the external imports to use lazyloader in path. It cuts the workbench load time from about 15 seconds to around 3, everything still appears to be functioning correctly. It's committed to the branch I posted earlier.
Re: Lazy loading of python modules
Thanks.etrombly wrote: ↑Fri Apr 10, 2020 12:57 am Copying to Ext works for the build, need to check the right path for install. Modified most of the external imports to use lazyloader in path. It cuts the workbench load time from about 15 seconds to around 3, everything still appears to be functioning correctly. It's committed to the branch I posted earlier.
I will try to build and test your branch on Win in the next days.
"fight the good fight"
Re: Lazy loading of python modules
Everything installs OK. I think Ext is the proper place. Activation of Path is significantly improved. Nice work!
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20513 +4 (Git)
Build type: Release
Branch: lazyloader
Hash: a42219163aec573870a5f1f5f034a7396b6cb3f8
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)
"fight the good fight"
Re: Lazy loading of python modules
Nice!
@sgrogan why not add it to src/3rdParty per the suggestion of @vocx ?
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: Lazy loading of python modules
3rdParty isn't on the python path. That's where I put it in the source, but install it to Ext.
Thanks for testing @sgrogan. Need to figure out why the tests are failing with python 2 now, don't have a dev environment setup for it though. May take me a while.
Re: Lazy loading of python modules
I think this is the correct solution. Thanks @vocx as well. 3rdPary is the correct place in the src. We are trying not to have 3rd party source if there is a maintained package that can be a dependency. In this case we are using a small subset of the existing package so I think it makes sense to include in the src so we don't require the full python package.
IMHO I propose you ignore it. Or try/except it. We will be dropping PY2 as EOL after 0.19 release and I think the policy is to support PY2 "if its not too much trouble".
"fight the good fight"
Re: Lazy loading of python modules
Question: Was documentation ever written for this functionality ? is it on the wiki ?
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: Lazy loading of python modules
"fight the good fight"