mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19: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
|
@ -6,6 +6,7 @@ use std::collections::HashMap;
|
|||
|
||||
use base::id::BroadcastChannelRouterId;
|
||||
use constellation_traits::BroadcastChannelMsg;
|
||||
use fnv::FnvHashMap;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use log::warn;
|
||||
use servo_url::ImmutableOrigin;
|
||||
|
@ -13,7 +14,7 @@ use servo_url::ImmutableOrigin;
|
|||
#[derive(Default)]
|
||||
pub(crate) struct BroadcastChannels {
|
||||
/// A map of broadcast routers to their IPC sender.
|
||||
routers: HashMap<BroadcastChannelRouterId, IpcSender<BroadcastChannelMsg>>,
|
||||
routers: FnvHashMap<BroadcastChannelRouterId, IpcSender<BroadcastChannelMsg>>,
|
||||
|
||||
/// A map of origin to a map of channel name to a list of relevant routers.
|
||||
channels: HashMap<ImmutableOrigin, HashMap<String, Vec<BroadcastChannelRouterId>>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue