mirror of
https://github.com/python/cpython
synced 2024-10-14 09:31:57 +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
|
@ -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…
Reference in a new issue