mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Store slow selector flags in a hashmap.
This reduces the flag setting overhead on a pessimal testcase from over a second to ~20ms.
This commit is contained in:
parent
a32596131a
commit
297dc33a9f
5 changed files with 112 additions and 42 deletions
|
@ -67,6 +67,7 @@ use shared_lock::Locked;
|
|||
use sink::Push;
|
||||
use std::cell::RefCell;
|
||||
use std::fmt;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::ptr;
|
||||
use std::sync::Arc;
|
||||
use string_cache::{Atom, Namespace, WeakAtom, WeakNamespace};
|
||||
|
@ -705,6 +706,14 @@ impl<'le> PartialEq for GeckoElement<'le> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'le> Eq for GeckoElement<'le> {}
|
||||
|
||||
impl<'le> Hash for GeckoElement<'le> {
|
||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
(self.0 as *const _).hash(state);
|
||||
}
|
||||
}
|
||||
|
||||
impl<'le> PresentationalHintsSynthetizer for GeckoElement<'le> {
|
||||
fn synthesize_presentational_hints_for_legacy_attributes<V>(&self, hints: &mut V)
|
||||
where V: Push<ApplicableDeclarationBlock>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue