Message355631
Good point. Thanks for the advice. I've updated it to use timeit. Does that give a better indication?
import zipfile
test_zip = "time_test.zip"
test_name = "test_name.txt"
# with zipfile.ZipFile(test_zip, "w") as zf:
# zf.writestr(test_name, "Hi there! " * 300)
def test():
with zipfile.ZipFile(test_zip) as zf:
for i in range(100000):
zf.read(test_name)
if __name__ == "__main__":
import timeit
print(timeit.repeat("test()", setup="from __main__ import test", number=1, repeat=10))
On my machine (running a usual workload) the best of 10 was:
master:
3.812s
check closed:
3.874s
But I think my machine had a quite a bit of variance between runs. |
|
Date |
User |
Action |
Args |
2019-10-29 08:45:45 | dhillier | set | recipients:
+ dhillier, serhiy.storchaka |
2019-10-29 08:45:45 | dhillier | set | messageid: <1572338745.23.0.435465032692.issue37523@roundup.psfhosted.org> |
2019-10-29 08:45:45 | dhillier | link | issue37523 messages |
2019-10-29 08:45:45 | dhillier | create | |
|