New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
script: Make PartialEq
on element type IDs generate a lot less code.
#6308
Conversation
Critic review: https://critic.hoppipolla.co.uk/r/5216 This is an external review system which you may optionally use for the code review of your pull request. In order to help critic track your changes, please do not make in-place history rewrites (e.g. via |
#[allow(unsafe_code)] | ||
fn eq(&self, other: &HTMLTableCellElementTypeId) -> bool { | ||
unsafe { | ||
intrinsics::discriminant_value(self) == intrinsics::discriminant_value(other) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't this be written in safe code by casting to u8
and comparing that?
Could we somehow just use something like memcmp? |
|
-S-awaiting-review +S-needs-code-changes Review status: all files reviewed, 3 unresolved discussions, all commit checks successful.
components/script/dom/eventtarget.rs, line 84 [r1] (raw file): components/script/dom/htmlmediaelement.rs, line 58 [r1] (raw file): Comments from the review on Reviewable.io |
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.)
b1bf4e3
to
8c210e1
Compare
Removed unsafe code where I could. r? @nox |
@bors-servo: r+ -S-awaiting-review +S-awaiting-merge Review status: all files reviewed, 3 unresolved discussions, all commit checks successful.
Comments from the review on Reviewable.io |
📌 Commit 8c210e1 has been approved by |
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.) r? any DOM expert <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6308) <!-- Reviewable:end -->
This makes the difference between selector matching scaling on the ARM
Cortex-A9 and not, because the auto-derived
PartialEq
implementationblows 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.)
r? any DOM expert