Message381255
Yurii, I don't believe that benchmark measures what you need to measure (once imported module is kept imported forever until unloaded, so successive imports are no-ops).
See how the side effects of importing bbb only happen once:
% cat bbb.py
import time
time.sleep(1)
with open('bbb.log', 'a') as f:
written = f.write('hello\n')
assert written == 6
% time python -m timeit "import bbb"
1 loop, best of 5: 515 nsec per loop
python -m timeit "import bbb" 0.03s user 0.01s system 4% cpu 1.050 total
% cat bbb.log
hello |
|
Date |
User |
Action |
Args |
2020-11-17 16:47:32 | jstasiak | set | recipients:
+ jstasiak, methane, Mark.Shannon, serhiy.storchaka, corona10, uriyyo |
2020-11-17 16:47:32 | jstasiak | set | messageid: <1605631652.56.0.476480776167.issue42202@roundup.psfhosted.org> |
2020-11-17 16:47:32 | jstasiak | link | issue42202 messages |
2020-11-17 16:47:32 | jstasiak | create | |
|