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

View File

@ -79,4 +79,4 @@ wasmtimer = "0.2.0"
lazy_static = "1.4.0"
wasm-bindgen-test = "0.3.42"
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> {
// 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)?;
output.shrink_to_fit();