perf: move 512KB I/O buffer from stack to heap in chunked upload assembly

- Async Future size drops from ~525KB to ~5KB
- Eliminates stack overflow risk and reduces work-stealing copy cost
This commit is contained in:
Dionisio
2026-02-23 22:41:50 +01:00
parent 41b5500b77
commit 1da284a841
@@ -648,7 +648,7 @@ impl ChunkedUploadService {
let mut chunk_file = File::open(&chunk_path)
.await
.map_err(|e| format!("Failed to open chunk {}: {}", chunk.index, e))?;
let mut buf = [0u8; 524_288];
let mut buf = vec![0u8; 524_288];
loop {
let n = tokio::io::AsyncReadExt::read(&mut chunk_file, &mut buf)
.await