some optimization using rustc-hash, parking_lot and tikv-jemallocator

This commit is contained in:
Jun Kurihara 2022-06-28 16:55:07 -04:00
commit 3e850e8410
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
5 changed files with 27 additions and 25 deletions

View file

@ -1,5 +1,6 @@
#[cfg(not(target_env = "msvc"))]
#[global_allocator]
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
mod backend;
mod config;
@ -21,7 +22,8 @@ use crate::{
use futures::future::select_all;
use hyper::Client;
// use hyper_trust_dns::TrustDnsResolver;
use std::{collections::HashMap, io::Write, sync::Arc};
use rustc_hash::FxHashMap as HashMap;
use std::{io::Write, sync::Arc};
use tokio::time::Duration;
fn main() {
@ -63,7 +65,7 @@ fn main() {
let mut backends = Backends {
default_app: None,
apps: HashMap::<String, Backend>::new(),
apps: HashMap::<String, Backend>::default(),
};
let _ = parse_opts(&mut globals, &mut backends).expect("Invalid configuration");