an efficient binary archive format
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

streaming io for vacuum

zach c184f7c1 e7d17546

+4 -4
+4 -4
src/bindle.rs
··· 210 210 211 211 // Copy only live entries from original to temp 212 212 for entry in self.index.values_mut() { 213 - let mut buf = vec![0u8; entry.compressed_size() as usize]; 214 213 self.file.seek(SeekFrom::Start(entry.offset()))?; 215 - self.file.read_exact(&mut buf)?; 216 - 217 214 temp_file.seek(SeekFrom::Start(current_offset))?; 218 - temp_file.write_all(&buf)?; 215 + 216 + // Stream data without allocating full buffer 217 + let mut limited = (&mut self.file).take(entry.compressed_size()); 218 + io::copy(&mut limited, &mut temp_file)?; 219 219 220 220 entry.set_offset(current_offset); 221 221 let pad = pad::<8, u64>(entry.compressed_size());