Skip to content

Commit 6655345

Browse files
committed
perf(linter): use FxDashMap for module cache (#7522)
Same as #7521. Use `FxDashMap` instead of plain `DashMap` for module cache.
1 parent 4a98230 commit 6655345

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/oxc_linter/src/service/module_cache.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ use std::{
55

66
use dashmap::{mapref::one::Ref, DashMap};
77
use oxc_semantic::ModuleRecord;
8-
use rustc_hash::FxHashMap;
8+
use rustc_hash::{FxBuildHasher, FxHashMap};
99
use std::num::NonZeroUsize;
1010

11+
type FxDashMap<K, V> = DashMap<K, V, FxBuildHasher>;
12+
1113
/// `CacheState` and `CacheStateEntry` are used to fix the problem where
1214
/// there is a brief moment when a concurrent fetch can miss the cache.
1315
///
@@ -26,7 +28,7 @@ enum CacheStateEntry {
2628
}
2729

2830
/// Keyed by canonicalized path
29-
type ModuleMap = DashMap<Box<Path>, ModuleState>;
31+
type ModuleMap = FxDashMap<Box<Path>, ModuleState>;
3032

3133
#[derive(Clone)]
3234
pub(super) enum ModuleState {

0 commit comments

Comments
 (0)