Skip to content

Commit

Permalink
refactor: change some comments about blocking (not needed with future…
Browse files Browse the repository at this point in the history
…s::future::join_all) and zstd compression concerns
  • Loading branch information
Mili committed Feb 25, 2025
1 parent eed3632 commit ce11fce
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion pumpkin-world/src/chunk/format/linear.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl ChunkSerializer for LinearFile {
data_buffer.extend_from_slice(chunk);
}

// TODO: find ways to improve performance (maybe zstd lib has memory leaks)
// TODO: maybe zstd lib has memory leaks
let compressed_buffer = zstd::bulk::compress(
data_buffer.as_slice(),
ADVANCED_CONFIG.chunk.compression.level as i32,
Expand Down
4 changes: 0 additions & 4 deletions pumpkin-world/src/chunk/io/chunk_file_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ impl<S: ChunkSerializer> ChunkFileManager<S> {
.await
.map_err(|err| ChunkReadingError::IoError(err.kind()))?;

//We need to make this operation blocking to avoid context switching
// and improve compute heavy operations performance (like decompression)
S::from_bytes(&file_bytes)?
}
Err(ChunkReadingError::ChunkNotExist) => S::default(),
Expand Down Expand Up @@ -155,8 +153,6 @@ impl<S: ChunkSerializer> ChunkFileManager<S> {
.await
.map_err(|err| ChunkWritingError::IoError(err.kind()))?;

//We need to make this operation blocking to avoid context switching
// and improve compute heavy operations performance (like compression)
file.write_all(&serializer.to_bytes())
.await
.map_err(|err| ChunkWritingError::IoError(err.kind()))?;
Expand Down

0 comments on commit ce11fce

Please sign in to comment.