From ce11fced69066f057aa91694bd9d170723c8f455 Mon Sep 17 00:00:00 2001 From: Mili Date: Tue, 25 Feb 2025 01:59:14 +0000 Subject: [PATCH] refactor: change some comments about blocking (not needed with futures::future::join_all) and zstd compression concerns --- pumpkin-world/src/chunk/format/linear.rs | 2 +- pumpkin-world/src/chunk/io/chunk_file_manager.rs | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/pumpkin-world/src/chunk/format/linear.rs b/pumpkin-world/src/chunk/format/linear.rs index 6873208e9..81398495c 100644 --- a/pumpkin-world/src/chunk/format/linear.rs +++ b/pumpkin-world/src/chunk/format/linear.rs @@ -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, diff --git a/pumpkin-world/src/chunk/io/chunk_file_manager.rs b/pumpkin-world/src/chunk/io/chunk_file_manager.rs index c767220e7..0571114c7 100644 --- a/pumpkin-world/src/chunk/io/chunk_file_manager.rs +++ b/pumpkin-world/src/chunk/io/chunk_file_manager.rs @@ -107,8 +107,6 @@ impl ChunkFileManager { .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(), @@ -155,8 +153,6 @@ impl ChunkFileManager { .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()))?;