Compare commits

...

2 Commits

Author SHA1 Message Date
Aydin Mercan 986d668209
server: don't use parking_lot explicitly anymore
As of Rust 1.62, standard locks will recieve a massive performance
improvement (speed and memory footprint) on Linux.

parking_lot seems to be still be better [1] for the ordinary usecase
but I will still remove it preemptively for 2 reasons:

1. The application isn't still usable, I don't have any benchmarks where
   parking_lot is needed because of critical locks causing a noticable
   bottleneck. (I doubt it will be case anyway)

2. Having a smaller explicit dependency chain is good for
   maintainability. (Don't take this too far as to reduce usability
   though)

Tokio still uses parking_lot by default in itself.
Maybe I'll get rid of it after bumping MSRV to 1.62.

[1]: https://twitter.com/m_ou_se/status/1526220580361490438
2022-05-31 11:46:47 +03:00
Aydin Mercan 1b16619c7c
cargo: minor dependency bump 2022-05-27 10:59:01 +03:00
3 changed files with 13 additions and 16 deletions

24
Cargo.lock generated
View File

@ -169,7 +169,6 @@ dependencies = [
"axum",
"blake2",
"clap",
"parking_lot",
"rand",
"rusqlite",
"serde",
@ -177,7 +176,7 @@ dependencies = [
"tokio",
"tracing",
"tracing-subscriber",
"uuid 1.0.0",
"uuid 1.1.0",
]
[[package]]
@ -422,9 +421,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
[[package]]
name = "hyper"
version = "0.14.18"
version = "0.14.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b26ae0a80afebe130861d90abf98e3814a4f28a4c6ffeb5ab8ebb2be311e0ef2"
checksum = "42dc3c131584288d375f2d07f822b0cb012d8c6fb899a5b9fdb3cb7eb9b6004f"
dependencies = [
"bytes",
"futures-channel",
@ -446,9 +445,9 @@ dependencies = [
[[package]]
name = "indexmap"
version = "1.8.1"
version = "1.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee"
checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a"
dependencies = [
"autocfg",
"hashbrown",
@ -565,15 +564,15 @@ checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225"
[[package]]
name = "os_str_bytes"
version = "6.0.1"
version = "6.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "029d8d0b2f198229de29dca79676f2738ff952edf3fde542eb8bf94d8c21b435"
checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa"
[[package]]
name = "parking_lot"
version = "0.12.0"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58"
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
dependencies = [
"lock_api",
"parking_lot_core",
@ -1064,7 +1063,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bc28f93baff38037f64e6f43d34cfa1605f27a49c34e8a04c5e78b0babf2596"
dependencies = [
"ansi_term",
"parking_lot",
"sharded-slab",
"smallvec",
"thread_local",
@ -1098,9 +1096,9 @@ checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
[[package]]
name = "uuid"
version = "1.0.0"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cfcd319456c4d6ea10087ed423473267e1a071f3bc0aa89f80d60997843c6f0"
checksum = "93bbc61e655a4833cf400d0d15bf3649313422fa7572886ad6dab16d79886365"
dependencies = [
"getrandom",
"serde",

View File

@ -12,14 +12,13 @@ argon2 = "0.4"
blake2 = "0.10"
axum = { version = "0.5", features = ["http2"] }
clap = { version = "3.1", features = ["derive"] }
parking_lot = "0.12"
rand = "0.8"
rusqlite = { version = "0.27", features = ["serde_json", "time", "uuid"] }
serde = { version = "1", features = ["derive"] }
time = { version = "0.3", features = ["serde"] }
tokio = { version = "1.18", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["parking_lot"] }
tracing-subscriber = "0.3"
uuid = { version = "1", features = ["v4", "serde"] }
[profile.release]

View File

@ -6,10 +6,10 @@ mod server;
use std::collections::HashMap;
use std::option::Option;
use std::process::{ExitCode, Termination};
use std::sync::RwLock;
use anyhow::Result;
use clap::{Parser, Subcommand};
use parking_lot::RwLock;
pub type CsrfMap = RwLock<HashMap<String, String>>;