diff --git a/crates/ra_assists/src/handlers/reorder_fields.rs b/crates/ra_assists/src/handlers/reorder_fields.rs
index 897da283238..bc58ce5fe19 100644
--- a/crates/ra_assists/src/handlers/reorder_fields.rs
+++ b/crates/ra_assists/src/handlers/reorder_fields.rs
@@ -1,7 +1,7 @@
-use std::collections::HashMap;
+use itertools::Itertools;
+use rustc_hash::FxHashMap;
 
 use hir::{Adt, ModuleDef, PathResolution, Semantics, Struct};
-use itertools::Itertools;
 use ra_ide_db::RootDatabase;
 use ra_syntax::{algo, ast, match_ast, AstNode, SyntaxKind, SyntaxKind::*, SyntaxNode};
 
@@ -87,7 +87,7 @@ fn struct_definition(path: &ast::Path, sema: &Semantics<RootDatabase>) -> Option
     }
 }
 
-fn compute_fields_ranks(path: &ast::Path, ctx: &AssistContext) -> Option<HashMap<String, usize>> {
+fn compute_fields_ranks(path: &ast::Path, ctx: &AssistContext) -> Option<FxHashMap<String, usize>> {
     Some(
         struct_definition(path, &ctx.sema)?
             .fields(ctx.db)
diff --git a/crates/ra_ssr/src/parsing.rs b/crates/ra_ssr/src/parsing.rs
index 90c13dbc260..1ae166d196c 100644
--- a/crates/ra_ssr/src/parsing.rs
+++ b/crates/ra_ssr/src/parsing.rs
@@ -165,7 +165,7 @@ fn parse_pattern(pattern_str: &str) -> Result<Vec<PatternElement>, SsrError> {
 /// Checks for errors in a rule. e.g. the replace pattern referencing placeholders that the search
 /// pattern didn't define.
 fn validate_rule(rule: &SsrRule) -> Result<(), SsrError> {
-    let mut defined_placeholders = std::collections::HashSet::new();
+    let mut defined_placeholders = FxHashSet::default();
     for p in &rule.pattern.raw.tokens {
         if let PatternElement::Placeholder(placeholder) = p {
             defined_placeholders.insert(&placeholder.ident);
diff --git a/crates/rust-analyzer/src/cli/analysis_stats.rs b/crates/rust-analyzer/src/cli/analysis_stats.rs
index 2f4c29e0682..9d09501cd90 100644
--- a/crates/rust-analyzer/src/cli/analysis_stats.rs
+++ b/crates/rust-analyzer/src/cli/analysis_stats.rs
@@ -1,7 +1,11 @@
 //! Fully type-check project and print various stats, like the number of type
 //! errors.
 
-use std::{collections::HashSet, path::Path, time::Instant};
+use std::{path::Path, time::Instant};
+
+use itertools::Itertools;
+use rand::{seq::SliceRandom, thread_rng};
+use rustc_hash::FxHashSet;
 
 use hir::{
     db::{AstDatabase, DefDatabase, HirDatabase},
@@ -9,10 +13,8 @@ use hir::{
 };
 use hir_def::FunctionId;
 use hir_ty::{Ty, TypeWalk};
-use itertools::Itertools;
 use ra_db::SourceDatabaseExt;
 use ra_syntax::AstNode;
-use rand::{seq::SliceRandom, thread_rng};
 use stdx::format_to;
 
 use crate::cli::{load_cargo::load_cargo, progress_report::ProgressReport, Result, Verbosity};
@@ -33,7 +35,7 @@ pub fn analysis_stats(
     println!("Database loaded {:?}", db_load_time.elapsed());
     let analysis_time = Instant::now();
     let mut num_crates = 0;
-    let mut visited_modules = HashSet::new();
+    let mut visited_modules = FxHashSet::default();
     let mut visit_queue = Vec::new();
 
     let mut krates = Crate::all(db);
diff --git a/crates/rust-analyzer/src/cli/diagnostics.rs b/crates/rust-analyzer/src/cli/diagnostics.rs
index 82b3a8a5326..6f3c1c1f960 100644
--- a/crates/rust-analyzer/src/cli/diagnostics.rs
+++ b/crates/rust-analyzer/src/cli/diagnostics.rs
@@ -1,11 +1,14 @@
 //! Analyze all modules in a project for diagnostics. Exits with a non-zero status
 //! code if any errors are found.
 
+use std::path::Path;
+
 use anyhow::anyhow;
+use rustc_hash::FxHashSet;
+
 use hir::Crate;
 use ra_db::SourceDatabaseExt;
 use ra_ide::Severity;
-use std::{collections::HashSet, path::Path};
 
 use crate::cli::{load_cargo::load_cargo, Result};
 
@@ -20,7 +23,7 @@ pub fn diagnostics(
     let analysis = host.analysis();
 
     let mut found_error = false;
-    let mut visited_files = HashSet::new();
+    let mut visited_files = FxHashSet::default();
 
     let mut work = Vec::new();
     let krates = Crate::all(db);
diff --git a/crates/rust-analyzer/src/diagnostics.rs b/crates/rust-analyzer/src/diagnostics.rs
index 1cf50b677fc..b46281c985e 100644
--- a/crates/rust-analyzer/src/diagnostics.rs
+++ b/crates/rust-analyzer/src/diagnostics.rs
@@ -1,14 +1,14 @@
 //! Book keeping for keeping diagnostics easily in sync with the client.
 pub(crate) mod to_proto;
 
-use std::{collections::HashMap, mem, sync::Arc};
+use std::{mem, sync::Arc};
 
 use ra_ide::FileId;
-use rustc_hash::FxHashSet;
+use rustc_hash::{FxHashMap, FxHashSet};
 
 use crate::lsp_ext;
 
-pub(crate) type CheckFixes = Arc<HashMap<FileId, Vec<Fix>>>;
+pub(crate) type CheckFixes = Arc<FxHashMap<FileId, Vec<Fix>>>;
 
 #[derive(Debug, Default, Clone)]
 pub struct DiagnosticsConfig {
@@ -18,8 +18,8 @@ pub struct DiagnosticsConfig {
 
 #[derive(Debug, Default, Clone)]
 pub(crate) struct DiagnosticCollection {
-    pub(crate) native: HashMap<FileId, Vec<lsp_types::Diagnostic>>,
-    pub(crate) check: HashMap<FileId, Vec<lsp_types::Diagnostic>>,
+    pub(crate) native: FxHashMap<FileId, Vec<lsp_types::Diagnostic>>,
+    pub(crate) check: FxHashMap<FileId, Vec<lsp_types::Diagnostic>>,
     pub(crate) check_fixes: CheckFixes,
     changes: FxHashSet<FileId>,
 }
diff --git a/docs/dev/README.md b/docs/dev/README.md
index 11dc5261b60..6b6824ded1c 100644
--- a/docs/dev/README.md
+++ b/docs/dev/README.md
@@ -254,6 +254,11 @@ The default name is a lowercased name of the type: `global_state: GlobalState`.
 Avoid ad-hoc acronyms and contractions, but use the ones that exist consistently (`db`, `ctx`, `acc`).
 The default name for "result of the function" local variable is `res`.
 
+## Collection types
+
+We prefer `rustc_hash::FxHashMap` and `rustc_hash::FxHashSet` instead of the ones in `std::collections`.
+They use a hasher that's slightly faster and using them consistently will reduce code size by some small amount.
+
 ## Preconditions
 
 Function preconditions should generally be expressed in types and provided by the caller (rather than checked by callee):