Author jstasiak
Recipients Mark.Shannon, corona10, jstasiak, methane, serhiy.storchaka, uriyyo
Date 2020-11-17.16:47:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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 
import time
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 
Date User Action Args
2020-11-17 16:47:32jstasiaksetrecipients: + jstasiak, methane, Mark.Shannon, serhiy.storchaka, corona10, uriyyo
2020-11-17 16:47:32jstasiaksetmessageid: <>
2020-11-17 16:47:32jstasiaklinkissue42202 messages
2020-11-17 16:47:32jstasiakcreate