feat: change fxhash to ahash for hashmaps and hashsets

This commit is contained in:
Jun Kurihara 2025-01-06 17:42:43 +09:00
commit c0fcee71cf
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
18 changed files with 19 additions and 20 deletions

View file

@ -31,7 +31,7 @@ rpxy-lib = { path = "../rpxy-lib/", default-features = false, features = [
mimalloc = { version = "*", default-features = false }
anyhow = "1.0.95"
rustc-hash = "2.1.0"
ahash = "0.8.11"
serde = { version = "1.0.217", default-features = false, features = ["derive"] }
tokio = { version = "1.42.0", default-features = false, features = [
"net",

View file

@ -1,10 +1,10 @@
use super::toml::ConfigToml;
use crate::error::{anyhow, ensure};
use ahash::HashMap;
use clap::{Arg, ArgAction};
use hot_reload::{ReloaderReceiver, ReloaderService};
use rpxy_certs::{build_cert_reloader, CryptoFileSourceBuilder, CryptoReloader, ServerCryptoBase};
use rpxy_lib::{AppConfig, AppConfigList, ProxyConfig};
use rustc_hash::FxHashMap as HashMap;
#[cfg(feature = "acme")]
use rpxy_acme::{AcmeManager, ACME_DIR_URL, ACME_REGISTRY_PATH};

View file

@ -3,8 +3,8 @@ use crate::{
error::{anyhow, ensure},
log::warn,
};
use ahash::HashMap;
use rpxy_lib::{reexports::Uri, AppConfig, ProxyConfig, ReverseProxyConfig, TlsConfig, UpstreamUri};
use rustc_hash::FxHashMap as HashMap;
use serde::Deserialize;
use std::{fs, net::SocketAddr};
use tokio::time::Duration;
@ -232,7 +232,7 @@ impl ConfigToml {
// Check unused fields during deserialization
let t = toml::de::Deserializer::new(&config_str);
let mut unused = rustc_hash::FxHashSet::default();
let mut unused = ahash::HashSet::default();
let res = serde_ignored::deserialize(t, |path| {
unused.insert(path.to_string());