mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
Removed FnvHash and transformed the rest to FxHashmap (#39233)
This should be the final PR for the Hash Function series that is trivial. Of note: I decided to transform `HashMapTracedValues<Atom,..>` to use FxBuildHasher. This is likely not going to improve performance as Atom's already have a unique u32 that is used as the Hash but it safes a few bytes for the RandomState that is normally in the HashMap. Signed-off-by: Narfinger <Narfinger@users.noreply.github.com> Testing: Hash function changes should not change functionality, we slightly decrease the size and unit tests still work. Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
parent
726b456120
commit
84465e7768
55 changed files with 211 additions and 202 deletions
|
@ -9,6 +9,7 @@ use std::fmt;
|
|||
use embedder_traits::UntrustedNodeAddress;
|
||||
use js::rust::HandleValue;
|
||||
use layout_api::ElementsFromPointFlags;
|
||||
use rustc_hash::FxBuildHasher;
|
||||
use script_bindings::error::{Error, ErrorResult};
|
||||
use script_bindings::script_runtime::JSContext;
|
||||
use servo_arc::Arc;
|
||||
|
@ -307,7 +308,7 @@ impl DocumentOrShadowRoot {
|
|||
/// Remove any existing association between the provided id/name and any elements in this document.
|
||||
pub(crate) fn unregister_named_element(
|
||||
&self,
|
||||
id_map: &DomRefCell<HashMapTracedValues<Atom, Vec<Dom<Element>>>>,
|
||||
id_map: &DomRefCell<HashMapTracedValues<Atom, Vec<Dom<Element>>, FxBuildHasher>>,
|
||||
to_unregister: &Element,
|
||||
id: &Atom,
|
||||
) {
|
||||
|
@ -335,7 +336,7 @@ impl DocumentOrShadowRoot {
|
|||
/// Associate an element present in this document with the provided id/name.
|
||||
pub(crate) fn register_named_element(
|
||||
&self,
|
||||
id_map: &DomRefCell<HashMapTracedValues<Atom, Vec<Dom<Element>>>>,
|
||||
id_map: &DomRefCell<HashMapTracedValues<Atom, Vec<Dom<Element>>, FxBuildHasher>>,
|
||||
element: &Element,
|
||||
id: &Atom,
|
||||
root: DomRoot<Node>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue