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

@ -6,7 +6,7 @@
//
// Dropdown items within a group are collected into columns of 3 rows.
use std::collections::HashMap;
use rustc_hash::FxHashMap as HashMap;
use acadrust::types::{Color as AcadColor, LineWeight};
use iced::widget::{button, column, container, mouse_area, row, scrollable, svg, text};
@ -73,7 +73,7 @@ impl Ribbon {
wireframe: false,
ortho_mode: true,
open_dropdown: None,
last_cmd: HashMap::new(),
last_cmd: HashMap::default(),
layer_names: vec!["0".to_string()],
active_layer: "0".to_string(),
layer_infos: vec![LayerInfo {

View file

@ -1,7 +1,7 @@
// Shared rendering helpers, button styles, colours, layout constants, and
// free functions used by the Ribbon view/overlay methods.
use std::collections::HashMap;
use rustc_hash::FxHashMap as HashMap;
use std::time::Duration;
use acadrust::types::{Color as AcadColor, LineWeight};