Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use io.DEFAULT_BUFFER_SIZE instead of arbitrary number in gzip module
This improves the performance slightly, while also using a constant that is shared across the python code base.
  • Loading branch information
rhpvorderman committed Feb 25, 2021
commit 5cb09b0c8a655a2a893593579a02ddb0919879e6
2 changes: 1 addition & 1 deletion Lib/gzip.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ def main():
f = builtins.open(arg, "rb")
g = open(arg + ".gz", "wb")
while True:
chunk = f.read(1024)
chunk = f.read(io.DEFAULT_BUFFER_SIZE)
if not chunk:
break
g.write(chunk)
Expand Down