Further perf improv attempts

Reuse the buffer when decompressing the frames
This commit is contained in:
Lol3rrr
2024-09-22 18:12:31 +02:00
parent bead8549d4
commit c1e85d77dc
2 changed files with 22 additions and 5 deletions

View File

@@ -107,11 +107,9 @@ where
let mut entity_states = Vec::new();
for mut frame in frames.into_iter() {
frame
.decompress()
.map_err(|e| FirstPassError::DecompressFrame)?;
let data = frame.data().ok_or(FirstPassError::NoDataFrame)?;
let mut buffer = Vec::new();
for frame in frames.into_iter() {
let data = frame.decompress_with_buf(&mut buffer).map_err(|e| FirstPassError::DecompressFrame)?;
match frame.cmd {
DemoCommand::FileHeader => {