Commits
Click on a commit to change the comparison rangeReplace std::collections::HashMap with rustc_hash::FxHashMap
This commit replaces all usages of std::collections::HashMap with
rustc_hash::FxHashMap throughout the rspack codebase for better performance.
FxHashMap provides significantly better performance for string keys and
is already widely used in the Rust ecosystem for performance-critical
applications like rustc itself.
Changes:
- Replace import statements: std::collections::HashMap -> rustc_hash::FxHashMap as HashMap
- Update type annotations to use FxHashMap
- Add rustc-hash dependency to crates that needed it
- Handle special cases where external APIs (like LightningCSS) still require std HashMap
- Update HashMap construction from ::new() to ::default() where needed
All tests pass and compilation succeeds with these changes.