From ae88512082612f6f48c41fd43bc12630178fbe20 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 12 Oct 2023 17:29:35 +0200 Subject: [PATCH] Cargo: optimize feature flags of tokio Disable full feature of tokio, instead enable only necessary features, macros, net, rt-multi-thread. Doing that, build time drops by ~10%. --- Cargo.lock | 50 -------------------------------------------------- Cargo.toml | 2 +- 2 files changed, 1 insertion(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ff580e5..6366a57 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -597,16 +597,6 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" -[[package]] -name = "lock_api" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" -dependencies = [ - "autocfg", - "scopeguard", -] - [[package]] name = "log" version = "0.4.20" @@ -790,29 +780,6 @@ dependencies = [ "vcpkg", ] -[[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.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets", -] - [[package]] name = "pem-rfc7468" version = "0.7.0" @@ -1072,12 +1039,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "security-framework" version = "2.9.2" @@ -1155,15 +1116,6 @@ dependencies = [ "digest", ] -[[package]] -name = "signal-hook-registry" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" -dependencies = [ - "libc", -] - [[package]] name = "signature" version = "2.1.0" @@ -1321,9 +1273,7 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot", "pin-project-lite", - "signal-hook-registry", "socket2 0.5.3", "tokio-macros", "windows-sys", diff --git a/Cargo.toml b/Cargo.toml index 9ba09ae..8f7ecd7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] reqwest = "0.11" -tokio = { version = "1", features = ["full"] } +tokio = { version = "1", features = ["macros", "net", "rt-multi-thread"] } uuid = "1.2" sha2 = "0.10" url = "2"