crossbario / crossbar

Crossbar.io - WAMP application router
https://crossbar.io/
Other
2.05k stars 274 forks source link

add import time measurement script #1933

Closed oberstet closed 2 years ago

oberstet commented 2 years ago
cpy39_1) (base) oberstet@intel-nuci7:~/scm/crossbario/crossbar$ python -V
Python 3.9.4
(cpy39_1) (base) oberstet@intel-nuci7:~/scm/crossbario/crossbar$ python test/test_imports.py 

test 0 ("crossbar oss") ran in 0.929399068 seconds

test 1 ("crossbar full") ran in 2.662702488 seconds

test 2 ("cfxdb") ran in 2.094696954 seconds

test 3 ("all cfxdb deps") ran in 0.754102078 seconds

test 4 ("only autobahn") ran in 0.000396424 seconds

test 5 ("only zlmdb") ran in 0.181205956 seconds

(cpy39_1) (base) oberstet@intel-nuci7:~/scm/crossbario/crossbar$ 

so one Q is, why is importing all deps of cfxdb much quicker than importing cfxdb ...

oberstet commented 2 years ago

add the test to CI, eg https://github.com/crossbario/crossbar/runs/4950707708?check_suite_focus=true#step:7:1

test 1 ("only autobahn") ran in 0.00079036 seconds

test 2 ("xbr from autobahn") ran in 2.235032128 seconds

test 3 ("crossbar oss") ran in 1.169748947 seconds

test 4 ("crossbar full") ran in 2.788600055 seconds

test 5 ("only zlmdb") ran in 0.282525505 seconds

test 6 ("cfxdb") ran in 2.300577731 seconds

test 7 ("all cfxdb deps") ran in 0.936863742 seconds

this produces similar results as run locally:

(cpy39_1) (base) oberstet@intel-nuci7:~/scm/crossbario/crossbar$ python test/test_imports.py
test 1 ("only autobahn") ran in 0.000379289 seconds

test 2 ("xbr from autobahn") ran in 1.931631691 seconds

test 3 ("crossbar oss") ran in 0.89513178 seconds

test 4 ("crossbar full") ran in 2.389682195 seconds

test 5 ("only zlmdb") ran in 0.161411056 seconds

test 6 ("cfxdb") ran in 2.056823545 seconds

test 7 ("all cfxdb deps") ran in 0.760174707 seconds