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
Make size_of tests measure stylo and reduce the size of stylo PropertyDeclarations by 16 bytes #15953
Conversation
MozReview-Commit-ID: GMd1Huv8N5s
Heads up! This PR modifies the following files:
|
r? @Manishearth |
@bors-servo try |
Make size_of tests measure stylo Right now they don't, which means that we have four properties making PropertyDeclaration 16 bytes bigger than it should be. I'm not sure if there's a better way to get these tests to run against stylo than to hoist them into the properties file, but I couldn't figure it out. This seems good enough. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15953) <!-- Reviewable:end -->
I guess the other question is whether non-stylo test runs actually run tests from components/style or whether they're strictly limited to tests/unit/style. We certainly shouldn't disable these tests for normal servo runs. |
Also, the reason those properties are so large is that we have a bunch of extra fields on URL specified values for stylo. |
let new = size_of::<PropertyDeclaration>(); | ||
if new < old { | ||
panic!("Your changes have decreased the stack size of PropertyDeclaration enum from {} to {}. \ | ||
Good work! Please update the size in tests/unit/style/size_of.rs.", |
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.
This message references the old file.
These enum is present in large quantities in the style, and increasing the size \ | ||
may negatively affect style system performance. Please consider using `boxed=\"True\"` in \ | ||
the longhand If you feel that the increase is necessary, update to the new size in \ | ||
tests/unit/style/size_of.rs.", |
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.
This message references the old file.
It doesn't. There aren't supposed to be tests in components/, the only reason style is an exception is that bindgen generates layout tests inline and we have to run those for stylo. So you probably want to export a function that can be called from tests/unit and components/style |
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-gnu-dev, windows-msvc-dev |
We should consider having another |
@bholley This PR adds a However that involves recompiling the entire style crate (with |
... or, simply make a copy of |
MozReview-Commit-ID: KnXLfHfITyG
MozReview-Commit-ID: KapDMqX6OjH
Fixed up. r? @Manishearth |
@bors-servo r+ |
📌 Commit 6744ed1 has been approved by |
Make size_of tests measure stylo and reduce the size of stylo PropertyDeclarations by 16 bytes Right now they don't, which means that we have four properties making PropertyDeclaration 16 bytes bigger than it should be. I'm not sure if there's a better way to get these tests to run against stylo than to hoist them into the properties file, but I couldn't figure it out. This seems good enough. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15953) <!-- Reviewable:end -->
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-gnu-dev, windows-msvc-dev |
Right now they don't, which means that we have four properties making PropertyDeclaration 16 bytes bigger than it should be.
I'm not sure if there's a better way to get these tests to run against stylo than to hoist them into the properties file, but I couldn't figure it out. This seems good enough.
This change is