From bb28723ef0250c6fe3c2cbed947d90bb50a8f67d Mon Sep 17 00:00:00 2001 From: Logan Date: Wed, 4 Sep 2024 21:49:07 -0500 Subject: [PATCH] Tweaked output size and speed --- Cargo.lock | 27 +++++++++++++++++++++------ Cargo.toml | 6 ------ src/main.rs | 6 ++++-- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d98fe02..2608fa6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "ahash" version = "0.8.7" @@ -127,7 +133,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.7.1", "object", "rustc-demangle", ] @@ -416,7 +422,7 @@ dependencies = [ "flume", "half", "lebe", - "miniz_oxide", + "miniz_oxide 0.7.1", "rayon-core", "smallvec", "zune-inflate", @@ -447,12 +453,12 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.8.0", ] [[package]] @@ -1013,6 +1019,15 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + [[package]] name = "mio" version = "0.8.11" @@ -1220,7 +1235,7 @@ dependencies = [ "crc32fast", "fdeflate", "flate2", - "miniz_oxide", + "miniz_oxide 0.7.1", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 63ea0d1..d52b95d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,12 +15,6 @@ bytemuck = {version="1.14", features=["derive"]} futures-intrusive = "0.5" rust-cgi = "0.7" - -[profile.dev] -opt-level=1 -# codegen-units = 1 -# lto = "fat" - [profile.release] opt-level=3 codegen-units = 1 diff --git a/src/main.rs b/src/main.rs index e803f2e..1e711a4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -76,14 +76,16 @@ pub enum Error { } pub async fn make_quickdraw() -> Option>> { - Some(Arc::new(Mutex::new(QuickDraw::new(512, 512, 1000).await?))) + Some(Arc::new(Mutex::new( + QuickDraw::new(WIDTH as u32, HEIGHT as u32, 1000).await?, + ))) } pub async fn make_gif( input: &[u8], draw: Arc>, ) -> Result, Error> { - const STEP: usize = 20; + const STEP: usize = 30; const RADIUS: f32 = 7.0; let image = image::io::Reader::new(Cursor::new(input.to_vec().as_slice())) .with_guessed_format()