mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +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
|
@ -4,7 +4,6 @@
|
|||
|
||||
//! Messages send from the ScriptThread to the Constellation.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::fmt;
|
||||
|
||||
use base::Epoch;
|
||||
|
@ -22,6 +21,7 @@ use embedder_traits::{
|
|||
ViewportDetails, WebDriverMessageId,
|
||||
};
|
||||
use euclid::default::Size2D as UntypedSize2D;
|
||||
use fnv::FnvHashMap;
|
||||
use fonts_traits::SystemFontServiceProxySender;
|
||||
use http::{HeaderMap, Method};
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
|
@ -492,7 +492,7 @@ pub enum ScriptToConstellationMessage {
|
|||
/* The ids of ports transferred successfully */
|
||||
Vec<MessagePortId>,
|
||||
/* The ids, and buffers, of ports whose transfer failed */
|
||||
HashMap<MessagePortId, PortTransferInfo>,
|
||||
FnvHashMap<MessagePortId, PortTransferInfo>,
|
||||
),
|
||||
/// A new message-port was created or transferred, with corresponding control-sender.
|
||||
NewMessagePort(MessagePortRouterId, MessagePortId),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue