fix: Improve python writeS3File perf (#3182)

This commit is contained in:
Guillaume Bouvignies
2024-02-08 17:57:42 +01:00
committed by GitHub
parent f38a6d64c4
commit e00e3f9d2d
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -876,11 +876,11 @@ impl<R: AsyncRead> AsyncRead for ProgressReadAdapter<R> {
match this.interval.poll_tick(cx) {
Poll::Pending => {}
Poll::Ready(_) => {
tracing::info!("read {} bytes for s3 upload", *this.interval_bytes * 10);
*this.total_bytes += *this.interval_bytes;
tracing::info!("uploaded {} bytes for s3 upload", *this.total_bytes);
*this.interval_bytes = 0;
}
};
*this.total_bytes += *this.interval_bytes;
#[cfg(not(feature = "enterprise"))]
if *this.total_bytes > 50 * 1024 * 1024 {
+1 -1
View File
@@ -50,7 +50,7 @@ class S3BufferedReader(BufferedReader):
def bytes_generator(buffered_reader: BufferedReader | BytesIO):
while True:
byte = buffered_reader.read(1)
byte = buffered_reader.read(50 * 1024)
if not byte:
break
yield byte