mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +01:00
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:
parent
0ae9ee28d5
commit
5c7ea4bdee
19 changed files with 71 additions and 54 deletions
|
@ -26,6 +26,7 @@ crossbeam-channel = { workspace = true }
|
|||
devtools_traits = { workspace = true }
|
||||
embedder_traits = { workspace = true }
|
||||
euclid = { workspace = true }
|
||||
fnv = { workspace = true }
|
||||
ipc-channel = { workspace = true }
|
||||
keyboard-types = { workspace = true }
|
||||
malloc_size_of = { workspace = true }
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#![deny(missing_docs)]
|
||||
#![deny(unsafe_code)]
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -33,6 +32,7 @@ use embedder_traits::{
|
|||
MediaSessionActionType, ScriptToEmbedderChan, Theme, ViewportDetails, WebDriverScriptCommand,
|
||||
};
|
||||
use euclid::{Rect, Scale, Size2D, UnknownUnit};
|
||||
use fnv::FnvHashMap;
|
||||
use ipc_channel::ipc::{IpcReceiver, IpcSender};
|
||||
use keyboard_types::Modifiers;
|
||||
use malloc_size_of_derive::MallocSizeOf;
|
||||
|
@ -253,7 +253,7 @@ pub enum ScriptThreadMessage {
|
|||
SetWebGPUPort(IpcReceiver<WebGPUMsg>),
|
||||
/// The compositor scrolled and is updating the scroll states of the nodes in the given
|
||||
/// pipeline via the Constellation.
|
||||
SetScrollStates(PipelineId, HashMap<ExternalScrollId, LayoutVector2D>),
|
||||
SetScrollStates(PipelineId, FnvHashMap<ExternalScrollId, LayoutVector2D>),
|
||||
/// Evaluate the given JavaScript and return a result via a corresponding message
|
||||
/// to the Constellation.
|
||||
EvaluateJavaScript(PipelineId, JavaScriptEvaluationId, String),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue