compas-dev / compas-dev/compas_fab
over elaborate __init__ files are a performance hinderance
- Dominant language
- Python
- Stars
- 137
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Description
I have a small gripe with `compas_fab` over elaborate `__init__.py` files.
A specific example is `compas_fab/backends/__init__.py`
All of the backends are loaded, where you're most likely using a single one at the time.
Now, `ROS`, the `analytic` solver and `pybullet` are loaded even while its unlikely to use more one solver at the time.
( FWIW, I'm working on the `tesseract` backend )
Loading `pybullet` will take _seconds_ to load... and in the case of `macOs` pop-up a UI...
So a huge amount of unnecessary code is loaded...
Finally, the `__init__` arguable could be just be an empty file, rather then the 166 lines it is now.
The "hardcoded" ( dare I say Javaesque 👺 ) style of the current __init__ files are also stylistically a little substandard of the usual finesse and elegance of the `compas_fab` codebase.
( And then the irony of providing a `LazyLoader` in `compas_fab.utils.lazy_loader` 🧐 😉 )
Contributor guide
Assessment
This issue has not been assessed yet.