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
|
@ -6,19 +6,18 @@ use std::cell::RefCell;
|
|||
use std::collections::hash_map::Entry::{Occupied, Vacant};
|
||||
use std::default::Default;
|
||||
use std::ffi::CString;
|
||||
use std::hash::BuildHasherDefault;
|
||||
use std::mem;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::rc::Rc;
|
||||
|
||||
use deny_public_fields::DenyPublicFields;
|
||||
use dom_struct::dom_struct;
|
||||
use fnv::FnvHasher;
|
||||
use js::jsapi::JS::CompileFunction;
|
||||
use js::jsapi::{JS_GetFunctionObject, SupportUnscopables};
|
||||
use js::jsval::JSVal;
|
||||
use js::rust::{CompileOptionsWrapper, HandleObject, transform_u16_to_source_text};
|
||||
use libc::c_char;
|
||||
use rustc_hash::FxBuildHasher;
|
||||
use servo_url::ServoUrl;
|
||||
use style::str::HTML_SPACE_CHARACTERS;
|
||||
use stylo_atoms::Atom;
|
||||
|
@ -512,7 +511,7 @@ impl EventListeners {
|
|||
#[dom_struct]
|
||||
pub struct EventTarget {
|
||||
reflector_: Reflector,
|
||||
handlers: DomRefCell<HashMapTracedValues<Atom, EventListeners, BuildHasherDefault<FnvHasher>>>,
|
||||
handlers: DomRefCell<HashMapTracedValues<Atom, EventListeners, FxBuildHasher>>,
|
||||
}
|
||||
|
||||
impl EventTarget {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue