mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
Replace Hash Algorithm in HashMap/Set with FxHashMap/Set for simple types (#39166)
FxHash is faster than FnvHash and SipHash for simple types up to at least 64 bytes. The cryptographic guarantees are not needed for any types changed here because they are simple ids. This changes the types in script and net crates. In a future PR we will change the remaining Fnv to be also Fx unless there is a reason to keep them as Fnv. Testing: Should not change functionality but unit test and wpt will find it. Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
parent
1deb7b5957
commit
177f6d6502
46 changed files with 226 additions and 215 deletions
|
@ -5,9 +5,9 @@
|
|||
use core::cell::RefCell;
|
||||
use core::sync::atomic::Ordering;
|
||||
use std::cell::Ref;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use base::id::PipelineId;
|
||||
use rustc_hash::FxHashMap;
|
||||
use strum::VariantArray;
|
||||
|
||||
use crate::messaging::ScriptEventLoopSender;
|
||||
|
@ -20,7 +20,7 @@ enum TaskCancellers {
|
|||
/// of them need to have the same canceller flag for all task sources.
|
||||
Shared(TaskCanceller),
|
||||
/// For `Window` each `TaskSource` has its own canceller.
|
||||
OnePerTaskSource(RefCell<HashMap<TaskSourceName, TaskCanceller>>),
|
||||
OnePerTaskSource(RefCell<FxHashMap<TaskSourceName, TaskCanceller>>),
|
||||
}
|
||||
|
||||
impl TaskCancellers {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue