perf: use rustc-hash for HashMap and HashSet
This commit is contained in:
parent
4dae45733e
commit
5369b4eb29
17 changed files with 46 additions and 26 deletions
|
|
@ -1,8 +1,9 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
fmt::Debug,
|
||||
hash::Hash,
|
||||
mem,
|
||||
|
|
@ -357,7 +358,7 @@ pub struct BluerSessionState {
|
|||
wake_up_discover_tx: Sender<()>,
|
||||
wake_up_discover_rx: Option<Receiver<()>>,
|
||||
tx: Sender<BluerSessionEvent>,
|
||||
active_requests: Arc<Mutex<HashMap<BluerRequest, JoinHandle<anyhow::Result<()>>>>>,
|
||||
active_requests: Arc<Mutex<FxHashMap<BluerRequest, JoinHandle<anyhow::Result<()>>>>>,
|
||||
}
|
||||
|
||||
impl BluerSessionState {
|
||||
|
|
@ -540,7 +541,7 @@ impl BluerSessionState {
|
|||
wake_up_discover_rx: Some(wake_up_discover_rx),
|
||||
wake_up_discover_tx,
|
||||
tx,
|
||||
active_requests: Arc::new(Mutex::new(HashMap::new())),
|
||||
active_requests: Default::default(),
|
||||
};
|
||||
self_.process_requests(req_rx);
|
||||
self_.process_changes();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue