mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
perf(linter): use FxDashMap for module cache (#7522)
Same as #7521. Use `FxDashMap` instead of plain `DashMap` for module cache.
This commit is contained in:
parent
4a98230f07
commit
6655345bb9
1 changed files with 4 additions and 2 deletions
|
|
@ -5,9 +5,11 @@ use std::{
|
|||
|
||||
use dashmap::{mapref::one::Ref, DashMap};
|
||||
use oxc_semantic::ModuleRecord;
|
||||
use rustc_hash::FxHashMap;
|
||||
use rustc_hash::{FxBuildHasher, FxHashMap};
|
||||
use std::num::NonZeroUsize;
|
||||
|
||||
type FxDashMap<K, V> = DashMap<K, V, FxBuildHasher>;
|
||||
|
||||
/// `CacheState` and `CacheStateEntry` are used to fix the problem where
|
||||
/// there is a brief moment when a concurrent fetch can miss the cache.
|
||||
///
|
||||
|
|
@ -26,7 +28,7 @@ enum CacheStateEntry {
|
|||
}
|
||||
|
||||
/// Keyed by canonicalized path
|
||||
type ModuleMap = DashMap<Box<Path>, ModuleState>;
|
||||
type ModuleMap = FxDashMap<Box<Path>, ModuleState>;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub(super) enum ModuleState {
|
||||
|
|
|
|||
Loading…
Reference in a new issue