mirror of
https://github.com/servo/servo.git
synced 2025-07-23 23:33:43 +01:00
script: Make PartialEq
on element type IDs generate a lot less code.
This makes the difference between selector matching scaling on the ARM Cortex-A9 and not, because the auto-derived `PartialEq` implementation blows out the 32KB I-cache. With this change, there is a 2x improvement in selector matching over sequential when using all 8 cores. (More work needs to be done; this is a start.)
This commit is contained in:
parent
41095c01a7
commit
8c210e1a27
4 changed files with 83 additions and 8 deletions
|
@ -42,10 +42,17 @@ impl HTMLMediaElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[jstraceable]
|
||||
pub enum HTMLMediaElementTypeId {
|
||||
HTMLAudioElement,
|
||||
HTMLVideoElement,
|
||||
HTMLAudioElement = 0,
|
||||
HTMLVideoElement = 1,
|
||||
}
|
||||
|
||||
impl PartialEq for HTMLMediaElementTypeId {
|
||||
#[inline]
|
||||
fn eq(&self, other: &HTMLMediaElementTypeId) -> bool {
|
||||
(*self as u8) == (*other as u8)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue