This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dhillier
Recipients dhillier, serhiy.storchaka
Date 2019-10-29.08:45:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572338745.23.0.435465032692.issue37523@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-10-29 08:45:45dhilliersetrecipients: + dhillier, serhiy.storchaka
2019-10-29 08:45:45dhilliersetmessageid: <1572338745.23.0.435465032692.issue37523@roundup.psfhosted.org>
2019-10-29 08:45:45dhillierlinkissue37523 messages
2019-10-29 08:45:45dhilliercreate