constellation: Use FnvHashMap for hashmaps that use ids as keys (#39106)

FNV is faster for hashing less than 16 bytes of data and the
cryptographic properties of the default HashMap are not needed for the
various ids.

Testing: This does not change functionality.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
Narfinger 2025-09-03 20:15:19 +02:00 committed by GitHub
parent 0ae9ee28d5
commit 5c7ea4bdee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 71 additions and 54 deletions

View file

@ -5,7 +5,6 @@
#![allow(unsafe_code)]
use std::cell::{Cell, RefCell};
use std::collections::HashMap;
use std::fmt::Debug;
use std::process;
use std::rc::Rc;
@ -503,7 +502,7 @@ impl Layout for LayoutThread {
fn set_scroll_offsets_from_renderer(
&mut self,
scroll_states: &HashMap<ExternalScrollId, LayoutVector2D>,
scroll_states: &FnvHashMap<ExternalScrollId, LayoutVector2D>,
) {
let mut stacking_context_tree = self.stacking_context_tree.borrow_mut();
let Some(stacking_context_tree) = stacking_context_tree.as_mut() else {