You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running on an SBC with an SD card, enumerating the filesystem inside pkg_resources to find iotile plugins is very slow, adding 5-10 seconds to the start up time of any iotile command line script. It's not possible to actually speed up pkg_resources but in situations where we know that the user is not installing / removing plugins (i.e. when the file system is read only), we can prescan all installed plugins and produce an entry_points.txt file similar to the component registry that contains all of the entry points.
If this file exists it can be consulted before pkg_resources is imported to speed up application load time:
A new class in iotile.core.utilities called EntryPointManager that checks for entry_points.txt and loads it otherwise it loads pkg_resources. It should have an iter_entry_points API as a drop in replacement for pkg_resources usage.
Port all Coretools packages to use EntryPointManager rather than directly using pkg_resources.
For this to be useful it has to be an all or nothing thing. If anybody still imports pkg_resources the slow performance will return.
It seems like a lot of larger projects have the same issue with pkg_resources.iter_entry_points and are settling on the alternative entrypoints package: marcelotduarte/cx_Freeze#216 (comment).
There needs to be a clear logging message on program start saying that frozen plugins are being used so that users don't get confused and wonder why their newly pip installed packages aren't being detected.
When running on an SBC with an SD card, enumerating the filesystem inside
pkg_resources
to find iotile plugins is very slow, adding 5-10 seconds to the start up time of anyiotile
command line script. It's not possible to actually speed uppkg_resources
but in situations where we know that the user is not installing / removing plugins (i.e. when the file system is read only), we can prescan all installed plugins and produce anentry_points.txt
file similar to the component registry that contains all of the entry points.If this file exists it can be consulted before
pkg_resources
is imported to speed up application load time:See
pkg_resources
slow behavior, known bug, here:pypa/setuptools#926
The text was updated successfully, but these errors were encountered: