Change max comp ratio

This commit is contained in:
kozabrada123 2024-06-23 17:12:24 +02:00
parent f7f37fd7d7
commit f5ab117111
3 changed files with 4 additions and 25 deletions

23
Cargo.lock generated
View File

@ -299,16 +299,6 @@ dependencies = [
"zeroize", "zeroize",
] ]
[[package]]
name = "colored"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8"
dependencies = [
"lazy_static",
"windows-sys 0.48.0",
]
[[package]] [[package]]
name = "console_error_panic_hook" name = "console_error_panic_hook"
version = "0.1.7" version = "0.1.7"
@ -1408,15 +1398,6 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "num_threads"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "object" name = "object"
version = "0.32.2" version = "0.32.2"
@ -2170,9 +2151,7 @@ version = "5.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8c5dfa5e08767553704aa0ffd9d9794d527103c736aba9854773851fd7497eb" checksum = "e8c5dfa5e08767553704aa0ffd9d9794d527103c736aba9854773851fd7497eb"
dependencies = [ dependencies = [
"colored",
"log", "log",
"time",
"windows-sys 0.48.0", "windows-sys 0.48.0",
] ]
@ -2557,8 +2536,6 @@ checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e"
dependencies = [ dependencies = [
"deranged", "deranged",
"itoa", "itoa",
"libc",
"num_threads",
"powerfmt", "powerfmt",
"serde", "serde",
"time-core", "time-core",

View File

@ -79,4 +79,4 @@ wasmtimer = "0.2.0"
lazy_static = "1.4.0" lazy_static = "1.4.0"
wasm-bindgen-test = "0.3.42" wasm-bindgen-test = "0.3.42"
wasm-bindgen = "0.2.92" wasm-bindgen = "0.2.92"
simple_logger = "5.0.0" simple_logger = { version = "5.0.0", default-features=false }

View File

@ -92,7 +92,9 @@ impl GatewayMessage {
) -> Result<GatewayMessage, std::io::Error> { ) -> Result<GatewayMessage, std::io::Error> {
// Note: is there a better way to handle the size of this output buffer? // Note: is there a better way to handle the size of this output buffer?
let mut output = Vec::with_capacity(bytes.len() * 32); //
// This used to be 10, I measured it at 11.5, so a safe bet feels like 20
let mut output = Vec::with_capacity(bytes.len() * 20);
let _status = inflate.decompress_vec(bytes, &mut output, flate2::FlushDecompress::Sync)?; let _status = inflate.decompress_vec(bytes, &mut output, flate2::FlushDecompress::Sync)?;
output.shrink_to_fit(); output.shrink_to_fit();