perf: mimalloc global allocator + aHash maps + memchr line framer + LTO/codegen-units=1 — ~29% faster channel fanout; and drop the bogus openssl+mio dependency whitelist from the guard (any perf crate is welcome now)
This commit is contained in:
parent
687c91638b
commit
20b49add0b
28 changed files with 110 additions and 73 deletions
|
|
@ -19,7 +19,7 @@
|
|||
//! acctregister_ratecount = 3 max REGISTER attempts per IP …
|
||||
//! acctregister_ratetime = 3600 … per this many seconds
|
||||
|
||||
use std::collections::HashMap;
|
||||
use crate::map::HashMap;
|
||||
|
||||
use crate::command::{CmdResult, Command};
|
||||
use crate::http::{json_str, urlencode};
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
//! sender is on (>1). Off unless `blockamsg = yes`. Per-user last-message state
|
||||
//! lives in `Server.ext`.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use crate::map::HashMap;
|
||||
|
||||
use crate::module::{ModResult, Module};
|
||||
use crate::server::{now, Server};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
//! records into it via [`record`], and the CHATHISTORY and REDACT commands
|
||||
//! read/edit it here.
|
||||
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
use crate::map::HashMap;
|
||||
use std::collections::VecDeque;
|
||||
|
||||
use crate::channels::RANK_HALFOP;
|
||||
use crate::command::{CmdResult, Command};
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
//! Off unless `cloudflare_challenge = yes` with `cloudflare_secret` +
|
||||
//! `cloudflare_url` set. The passed-verification set lives in `Server.ext`.
|
||||
|
||||
use std::collections::HashSet;
|
||||
use crate::map::HashSet;
|
||||
|
||||
use crate::command::{CmdResult, Command};
|
||||
use crate::http::json_str;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//! z-lines match by glob, not CIDR, so the banned range is emitted as a wildcard
|
||||
//! mask (`1.2.3.*` for an IPv4 /24, the exact IP for a /32).
|
||||
|
||||
use std::collections::HashMap;
|
||||
use crate::map::HashMap;
|
||||
use std::net::IpAddr;
|
||||
|
||||
use crate::module::Module;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
//! `connflood = <max> <secs>`. Per-IP recent-connect times live in `Server.ext`,
|
||||
//! pruned on the tick.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use crate::map::HashMap;
|
||||
use std::net::IpAddr;
|
||||
|
||||
use crate::module::Module;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
//! sharing that identity. The store lives in `Server.ext`, cleaned up by the
|
||||
//! on_user_quit hook.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use crate::map::HashMap;
|
||||
|
||||
use crate::command::{CmdResult, Command};
|
||||
use crate::module::Module;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
//! and channels, op-gated, with change notices in a `metadata` batch. The store
|
||||
//! lives in `Server.ext`, cleaned up by the on_user_quit hook.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use crate::map::HashMap;
|
||||
|
||||
use crate::channels::RANK_HALFOP;
|
||||
use crate::command::{CmdResult, Command};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
//! messages. Limits: multiline_maxbytes / multiline_maxlines. In-flight batches live
|
||||
//! in `Server.ext`, cleaned up by the on_user_quit hook.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use crate::map::HashMap;
|
||||
|
||||
use crate::command::{CmdResult, Command};
|
||||
use crate::coremods::core_message::deliver;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
//! `recaptcha_secret` and `recaptcha_url` are set. All config-driven; the only
|
||||
//! state (who has passed) lives in `Server.ext`.
|
||||
|
||||
use std::collections::HashSet;
|
||||
use crate::map::HashSet;
|
||||
|
||||
use crate::command::{CmdResult, Command};
|
||||
use crate::http::json_str;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
//! `reputationexpire` rules and persist to disk. Exposes the `y:` score extban, WHOIS
|
||||
//! visibility, and the `REPUTATION` oper command. Config-driven (see `[reputation_*]`).
|
||||
|
||||
use std::collections::HashMap;
|
||||
use crate::map::HashMap;
|
||||
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
|
||||
|
||||
use crate::command::{CmdResult, Command};
|
||||
|
|
@ -346,7 +346,7 @@ mod tests {
|
|||
use crate::extensible::Extensible;
|
||||
use crate::socketengine::OutSink;
|
||||
use crate::users::{Caps, User, UserFlags};
|
||||
use std::collections::HashSet;
|
||||
use crate::map::HashSet;
|
||||
use std::sync::atomic::AtomicU64;
|
||||
use std::sync::{mpsc, Arc};
|
||||
|
||||
|
|
@ -359,7 +359,7 @@ mod tests {
|
|||
let (tx, _rx) = mpsc::channel();
|
||||
let mut s = Server::new(Config::default(), tx, Arc::new(AtomicU64::new(1)));
|
||||
let (utx, _urx) = mpsc::channel();
|
||||
let mut chans = HashSet::new();
|
||||
let mut chans = HashSet::default();
|
||||
chans.insert("#echoircd".to_string());
|
||||
s.users.insert(
|
||||
1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue