Daniel Hillier <[email protected]> added the comment:
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.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37523>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com