39
39
) ]
40
40
#![ cfg_attr( docsrs, feature( doc_auto_cfg) ) ]
41
41
42
- use std:: collections:: HashMap ;
43
42
use std:: fmt;
44
43
use std:: marker:: PhantomData ;
45
44
use std:: panic:: { RefUnwindSafe , UnwindSafe } ;
@@ -49,6 +48,7 @@ use std::sync::{Arc, Mutex, RwLock, TryLockError};
49
48
use std:: task:: { Poll , Waker } ;
50
49
use std:: thread:: { self , ThreadId } ;
51
50
51
+ use ahash:: AHashMap ;
52
52
use async_task:: { Builder , Runnable } ;
53
53
use concurrent_queue:: ConcurrentQueue ;
54
54
use futures_lite:: { future, prelude:: * } ;
@@ -693,7 +693,7 @@ struct State {
693
693
/// Local queues created by runners.
694
694
///
695
695
/// These are keyed by the thread that the runner originated in.
696
- local_queues : RwLock < HashMap < ThreadId , Vec < Arc < LocalQueue > > > > ,
696
+ local_queues : RwLock < AHashMap < ThreadId , Vec < Arc < LocalQueue > > > > ,
697
697
698
698
/// Set to `true` when a sleeping ticker is notified or no tickers are sleeping.
699
699
notified : AtomicBool ,
@@ -710,7 +710,7 @@ impl State {
710
710
const fn new ( ) -> State {
711
711
State {
712
712
queue : ConcurrentQueue :: unbounded ( ) ,
713
- local_queues : RwLock :: new ( HashMap :: new ( ) ) ,
713
+ local_queues : RwLock :: new ( AHashMap :: new ( ) ) ,
714
714
notified : AtomicBool :: new ( true ) ,
715
715
sleepers : Mutex :: new ( Sleepers {
716
716
count : 0 ,
@@ -1207,7 +1207,7 @@ fn debug_state(state: &State, name: &str, f: &mut fmt::Formatter<'_>) -> fmt::Re
1207
1207
}
1208
1208
1209
1209
/// Debug wrapper for the local runners.
1210
- struct LocalRunners < ' a > ( & ' a RwLock < HashMap < ThreadId , Vec < Arc < LocalQueue > > > > ) ;
1210
+ struct LocalRunners < ' a > ( & ' a RwLock < AHashMap < ThreadId , Vec < Arc < LocalQueue > > > > ) ;
1211
1211
1212
1212
impl fmt:: Debug for LocalRunners < ' _ > {
1213
1213
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
0 commit comments