Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Python app API import time #448

Open
CatGarab opened this issue Aug 12, 2019 · 1 comment
Open

Improve Python app API import time #448

CatGarab opened this issue Aug 12, 2019 · 1 comment
Labels
application Mission Applications for KubOS bug Something isn't working

Comments

@CatGarab
Copy link
Contributor

On the BBB, it currently takes ~ 2 seconds to run a Python application which imports the app API.

Running python -X importtime -c 'import app_api' breaks down the import time by package.

Going through that output, the biggest time suck is importing the requests library, which takes ~1.82sec. Underneath that, the urllib3 import takes ~1.13sec.

There are many issues floating around for the BBB (and RPi) dealing with slow Python imports, but no one has been able to determine a good solution.

We should look into removing the requests library as an app API dependency and replacing it with something that is much smaller (and therefore faster) to import.

List of related issues that no one seems to have solved:
adafruit/adafruit-beaglebone-io-python#245
pandas-dev/pandas#7282
psf/requests#3213
psf/requests#4278
psf/requests#4315
urllib3/urllib3#1590
psf/requests#5080
https://www.raspberrypi.org/forums/viewtopic.php?t=205132

@CatGarab CatGarab added bug Something isn't working application Mission Applications for KubOS labels Aug 12, 2019
@renaudl
Copy link

renaudl commented Mar 16, 2021

Couldn't this be lazy loaded on usage rather than by default?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
application Mission Applications for KubOS bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants