Moves to FxHashMap for Allocator, BHM, Canvas, Media, Servo, WebGL and WebGPU (#39202)

This moves more of HashMap/FnvHashMap to FxHashmap. Again we only
changed instances that do not look security related and have small keys.

Additionally, allocator used the fnv feature which did not seem to be
used.

Testing: Unit Tests and WPT should cover this and functionality change
is highly unlikely.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
Narfinger 2025-09-08 18:06:03 +02:00 committed by GitHub
parent 228b240635
commit d2c78db981
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 53 additions and 46 deletions

View file

@ -14,7 +14,7 @@ path = "lib.rs"
[dependencies]
compositing_traits = { workspace = true }
euclid = { workspace = true }
fnv = { workspace = true }
rustc-hash = { workspace = true }
ipc-channel = { workspace = true }
log = { workspace = true }
serde = { workspace = true }

View file

@ -6,9 +6,9 @@ use std::sync::{Arc, Mutex};
use std::thread;
use compositing_traits::{WebrenderExternalImageRegistry, WebrenderImageHandlerType};
use fnv::FnvHashMap;
use ipc_channel::ipc::{IpcSender, channel};
use log::{trace, warn};
use rustc_hash::FxHashMap;
use webrender_api::ExternalImageId;
/// GL player threading API entry point that lives in the
@ -19,7 +19,7 @@ use crate::{GLPlayerMsg, GLPlayerMsgForward};
/// a set of video players with GL render.
pub struct GLPlayerThread {
/// Map of live players.
players: FnvHashMap<u64, IpcSender<GLPlayerMsgForward>>,
players: FxHashMap<u64, IpcSender<GLPlayerMsgForward>>,
/// List of registered webrender external images.
/// We use it to get an unique ID for new players.
external_images: Arc<Mutex<WebrenderExternalImageRegistry>>,