perf(hash): swap std HashMap/HashSet for rustc-hash FxHash

Phase 4.1. Handle / u64 keys dominate the hot maps (block_defn,
hatch / image / mesh caches, draw-depth map, viewport wire caches);
the default SipHash is wasted work on integer keys. Alias the std
types to rustc_hash::FxHashMap / FxHashSet crate-wide so every map and
set — including the cross-module draw-depth map shared between scene
and the GPU pipelines — uses the faster hasher consistently.

Mechanical: no behavioural change. Constructors moved from ::new() to
::default() (Fx variants carry no RandomState). Build + 13 tests green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-05 00:35:53 +03:00
commit 70702d063f
30 changed files with 102 additions and 98 deletions

View file

@ -7,7 +7,7 @@
//! • Linetype → read-only for now
//! • Geometry → text_input per coordinate / dimension field
use std::collections::HashMap;
use rustc_hash::FxHashMap as HashMap;
use std::fmt;
use crate::ui::ROW_H;
@ -142,12 +142,12 @@ impl Default for PropertiesPanel {
selected_group: None,
linetype_items: vec![],
selection_group_combo: combo_box::State::new(vec![]),
choice_combos: HashMap::new(),
choice_combos: HashMap::default(),
layer_combo: combo_box::State::new(vec![]),
lineweight_combo: combo_box::State::new(lw_options()),
linetype_combo: combo_box::State::new(vec![]),
hatch_pattern_combo: combo_box::State::new(crate::scene::hatch_patterns::names()),
edit_buf: HashMap::new(),
edit_buf: HashMap::default(),
color_picker_open: false,
color_palette_open: false,
}