Closed CamDavidsonPilon closed 2 years ago
Through some import
handling, I got it down about 3-5x using the tool python3 -X importtime -c "import pioreactor"
The plugin system is about 33% of the start up time, specifically get_plugins
, specifically:
pioreactor_plugins = entry_points().get("pioreactor.plugins", [])
Running
pio
orpios
on the machines has a noticeable lag, and it's especially bad when running on a RpiZero. I don't want to overclock the machines - are there other ways to fix this?Some useful points here: https://files.bemusement.org/talks/OSDC2008-FastPython/
Imports
3rd party packages take time to import (either because the modules need to be loaded, or the packages are doing initialization work).
__init__.py
Delay MQTT calls
Originally,
pioreactor
had calls to the leader to get information at initialization - this is probably causing some latency duringpio
(who didn't need this information). Move to lazily load this information.