From a16f4e4e382655ae40f3edf6c6d63d9db4148d2b Mon Sep 17 00:00:00 2001 From: Lee Smet Date: Fri, 9 Feb 2024 11:41:37 +0100 Subject: [PATCH] Reduce tokio feature scope Instead of using "full", we now only use the features we need. This removes a few downstream dependencies, shortening build times slightly. This also means the "parking_lot" feature is no longer enabled. It is generally accepted that the default std::sync::Mutex which is now used again by tokio is faster for the general case than the parking_lot mutex implementation. Signed-off-by: Lee Smet --- Cargo.lock | 49 ------------------------------------------------- Cargo.toml | 10 +++++++++- 2 files changed, 9 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 18ba4f9..62aec60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -906,16 +906,6 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" -[[package]] -name = "lock_api" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" -dependencies = [ - "autocfg", - "scopeguard", -] - [[package]] name = "log" version = "0.4.20" @@ -1178,29 +1168,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.48.5", -] - [[package]] name = "paste" version = "1.0.14" @@ -1402,15 +1369,6 @@ dependencies = [ "yasna", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "regex" version = "1.10.3" @@ -1625,12 +1583,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "sct" version = "0.7.1" @@ -1908,7 +1860,6 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", diff --git a/Cargo.toml b/Cargo.toml index af31d9a..26099d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,15 @@ license-file = "LICENSE" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -tokio = { version = "1.36.0", features = ["full"] } +tokio = { version = "1.36.0", features = [ + "fs", + "macros", + "net", + "rt-multi-thread", + "signal", + "sync", + "time", +] } tokio-util = { version = "0.7.10", features = ["codec"] } clap = { version = "4.4.8", features = ["derive"] } futures = "0.3.29"