Skip to content

Commit

Permalink
update chunk size in order to make tidevice push faster
Browse files Browse the repository at this point in the history
  • Loading branch information
圣翔 committed Jul 11, 2023
1 parent 336bbac commit f6c695b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tidevice/_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def iter_content(self, path: typing.Union[str, pathlib.Path]) -> Iterator[bytes]

with self._context_open(path, AFCMode.O_RDONLY) as fd:
left_size = info.st_size
max_read_size = 1 << 16
max_read_size = 1 << 20
while left_size > 0:
chunk = self._file_read(fd, max_read_size)
left_size -= len(chunk)
Expand Down Expand Up @@ -421,7 +421,7 @@ def pull_content(self, path: str) -> bytearray:
def push_content(self, path: str, data: Union[typing.IO, bytes,
bytearray]):
with self._context_open(path, AFCMode.O_WR) as fd:
chunk_size = 1 << 15
chunk_size = 1 << 20

if isinstance(data, io.IOBase):
buf = data
Expand Down

0 comments on commit f6c695b

Please sign in to comment.