sensein / etelemetry-client

Etelemetry client
Other
3 stars 9 forks source link

use built-in http instead of heavier requests #29

Open yarikoptic opened 3 years ago

yarikoptic commented 3 years ago

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 ```shell (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 commented 3 years ago

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