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

use built-in http instead of heavier requests #29

Open
yarikoptic opened this issue Jan 5, 2021 · 1 comment
Open

use built-in http instead of heavier requests #29

yarikoptic opened this issue Jan 5, 2021 · 1 comment

Comments

@yarikoptic
Copy link
Collaborator

for etelemetry to be more "adoptable" it should not introduce "heavy" dependencies, in particular at run time. requests is relatively fast to import but still not as "fast" (and I did not check memory footprint), and might not actually be used by the code which would use etelemetry.

some timings showing that import of requests adds at least about 60 ms on my "fast" laptop
(git)lena:~/proj/repronim/etelemetry-client[master]git
$> multitime python3 -c 'import requests'         
===> multitime results
1: python3 -c "import requests"
            Mean        Std.Dev.    Min         Median      Max
real        0.118       0.000       0.118       0.118       0.118       
user        0.113       0.000       0.113       0.113       0.113       
sys         0.004       0.000       0.004       0.004       0.004       

$> multitime python3 -c 'import http'    
===> multitime results
1: python3 -c "import http"
            Mean        Std.Dev.    Min         Median      Max
real        0.058       0.000       0.058       0.058       0.058       
user        0.050       0.000       0.050       0.050       0.050       
sys         0.008       0.000       0.008       0.008       0.008 
yarikoptic added a commit to yarikoptic/etelemetry-client that referenced this issue Jan 5, 2021
It is a partial workaround for
sensein#29
where ultimately requests is not a dependency at all, but rather built-in http
is used for that minimal amount of interaction needed.

This minimal change should shave off about 60ms from etelemetry import/use
runtime whenever no refresh _etrequest is needed to be sent
@yarikoptic
Copy link
Collaborator Author

yarikoptic commented Jan 7, 2021

another metric: reproman tests started to fail while counting number of modules which get imported upon import of reproman.api -- it grew from under 230 to over 500 due to now import/run of etelemetry (see e.g. https://travis-ci.org/github/ReproNim/reproman/jobs/753067763). I would expect that most of that due to requests import

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant