mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-43317: Use io.DEFAULT_BUFFER_SIZE instead of 1024 in gzip CLI (#24645)
This improves the performance slightly.
This commit is contained in:
parent
25935a2881
commit
7956ef8849
2 changed files with 4 additions and 1 deletions
|
@ -595,7 +595,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)
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
Set the chunk size for the ``gzip`` module main function to
|
||||
io.DEFAULT_BUFFER_SIZE. This is slightly faster than the 1024 bytes constant
|
||||
that was used previously.
|
Loading…
Add table
Add a link
Reference in a new issue