Skip to content
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

Use SmallBitVec to optimize size of PropertyDeclarationBlock #18431

Merged
merged 2 commits into from
Sep 11, 2017

Conversation

mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented Sep 9, 2017

@highfive
Copy link

highfive commented Sep 9, 2017

Heads up! This PR modifies the following files:

  • @bholley: components/style/Cargo.toml, components/style/lib.rs, ports/geckolib/glue.rs, components/style/stylesheets/keyframes_rule.rs, components/style/sharing/mod.rs and 5 more
  • @canaltinova: components/style/Cargo.toml, components/style/lib.rs, components/style/stylesheets/keyframes_rule.rs, components/style/sharing/mod.rs, components/style/properties/properties.mako.rs and 4 more
  • @KiChjang: components/script/dom/cssstyledeclaration.rs
  • @fitzgen: components/script/dom/cssstyledeclaration.rs
  • @emilio: components/style/Cargo.toml, components/style/lib.rs, ports/geckolib/glue.rs, components/style/stylesheets/keyframes_rule.rs, components/style/sharing/mod.rs and 5 more

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Sep 9, 2017
@highfive
Copy link

highfive commented Sep 9, 2017

warning Warning warning

  • These commits modify style and script code, but no tests are modified. Please consider adding a test!

@mbrubeck
Copy link
Contributor Author

mbrubeck commented Sep 9, 2017

@bors-servo try

@bors-servo
Copy link
Contributor

⌛ Trying commit 0f258bb with merge 63ccc03...

bors-servo pushed a commit that referenced this pull request Sep 9, 2017
WIP: Use SmallBitVec to optimize size of PropertyDeclarationBlock

https://bugzilla.mozilla.org/show_bug.cgi?id=1398322

<!-- 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/18431)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - windows-msvc-dev

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Sep 9, 2017
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Sep 9, 2017
@mbrubeck
Copy link
Contributor Author

mbrubeck commented Sep 9, 2017

@bors-servo try

@bors-servo
Copy link
Contributor

⌛ Trying commit 216ebb4 with merge 256152a...

bors-servo pushed a commit that referenced this pull request Sep 9, 2017
WIP: Use SmallBitVec to optimize size of PropertyDeclarationBlock

https://bugzilla.mozilla.org/show_bug.cgi?id=1398322

<!-- 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/18431)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - mac-rel-css2

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Sep 9, 2017
@jdm
Copy link
Member

jdm commented Sep 9, 2017

  ▶ CRASH [expected FAIL] /css21_dev/html4/first-letter-punctuation-234.htm
  │ 
  │ VMware, Inc.
  │ Gallium 0.4 on softpipe
  │ 3.3 (Core Profile) Mesa 17.2.0-devel
  └ Shutting down the Constellation after generating an output file or exit flag specified

  ▶ CRASH [expected FAIL] /css21_dev/html4/first-letter-punctuation-236.htm
  │ 
  │ VMware, Inc.
  │ Gallium 0.4 on softpipe
  │ 3.3 (Core Profile) Mesa 17.2.0-devel
  └ Shutting down the Constellation after generating an output file or exit flag specified

  ▶ CRASH [expected FAIL] /css21_dev/html4/first-letter-punctuation-237.htm

  ▶ CRASH [expected FAIL] /css21_dev/html4/first-letter-punctuation-235.htm
  │ 
  │ VMware, Inc.
  │ Gallium 0.4 on softpipe
  │ 3.3 (Core Profile) Mesa 17.2.0-devel
  └ Shutting down the Constellation after generating an output file or exit flag specified

@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Sep 10, 2017
@mbrubeck
Copy link
Contributor Author

@bors-servo try

@bors-servo
Copy link
Contributor

⌛ Trying commit 606e597 with merge c92de04...

bors-servo pushed a commit that referenced this pull request Sep 10, 2017
WIP: Use SmallBitVec to optimize size of PropertyDeclarationBlock

https://bugzilla.mozilla.org/show_bug.cgi?id=1398322

<!-- 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/18431)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - mac-rel-css2

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Sep 10, 2017
@mbrubeck
Copy link
Contributor Author

@bors-servo retry

  • infra

@bors-servo
Copy link
Contributor

⌛ Trying commit 606e597 with merge e81e46e...

bors-servo pushed a commit that referenced this pull request Sep 10, 2017
WIP: Use SmallBitVec to optimize size of PropertyDeclarationBlock

https://bugzilla.mozilla.org/show_bug.cgi?id=1398322

<!-- 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/18431)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

@mbrubeck mbrubeck changed the title WIP: Use SmallBitVec to optimize size of PropertyDeclarationBlock Use SmallBitVec to optimize size of PropertyDeclarationBlock Sep 10, 2017
@mbrubeck
Copy link
Contributor Author

@bors-servo try-

I think this is ready now. r? @bholley

@highfive highfive assigned bholley and unassigned Manishearth Sep 10, 2017
@bholley
Copy link
Contributor

bholley commented Sep 10, 2017

See https://bugzilla.mozilla.org/show_bug.cgi?id=1398322#c14 regarding eq perf, which I think we should probably fix before landing, otherwise revalidation will get slower.

At a high-level this looks great otherwise, but given the unsafe code I think it probably deserves a more-careful review than I have cycles for at the moment, so probably @SimonSapin or @Manishearth should at least review the SmallBitVec code.

@mbrubeck
Copy link
Contributor Author

See https://bugzilla.mozilla.org/show_bug.cgi?id=1398322#c14 regarding eq perf, which I think we should probably fix before landing, otherwise revalidation will get slower.

The latest smallbitvec now has fast paths for eq.

@SimonSapin
Copy link
Member

r=me on this PR and https://github.com/servo/smallbitvec/blob/v1.0.2/src/lib.rs. While we’re at it, let’s land this with 1.0.3 instead of 1.0.2?


Reviewed 5 of 5 files at r1, 7 of 7 files at r2.
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


components/style/properties/declaration_block.rs, line 81 at r2 (raw file):

    /// The "important" flag for each declaration in `declarations`.
    important_declarations: SmallBitVec,

important_declarations sounds to be like it contains declarations that have the !important flag. Rename this to declarations_importance?


components/style/properties/declaration_block.rs, line 249 at r2 (raw file):

    pub fn get(&self, property: PropertyDeclarationId) -> Option<(&PropertyDeclaration, Importance)> {
        self.declarations.iter().position(|decl| decl.id() == property).map(|i| {
            let decl = &self.declarations[i];

To avoid indexing, could this use .enumerate().find(…) instead of .position(…)?


Comments from Reviewable

@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Sep 11, 2017
@mbrubeck
Copy link
Contributor Author

@bors-servo r=SimonSapin

Addressed all of the review comments above.

@bors-servo
Copy link
Contributor

📌 Commit a5a0e9f has been approved by SimonSapin

@highfive highfive assigned SimonSapin and unassigned bholley Sep 11, 2017
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Sep 11, 2017
@bors-servo
Copy link
Contributor

⌛ Testing commit a5a0e9f with merge e7f4502...

bors-servo pushed a commit that referenced this pull request Sep 11, 2017
Use SmallBitVec to optimize size of PropertyDeclarationBlock

https://bugzilla.mozilla.org/show_bug.cgi?id=1398322

<!-- 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/18431)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - mac-rel-wpt3

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Sep 11, 2017
@mbrubeck
Copy link
Contributor Author

@bors-servo retry

Infra

@bors-servo
Copy link
Contributor

⚡ Previous build results for android, linux-dev, mac-dev-unit, windows-msvc-dev are reusable. Rebuilding only arm32, arm64, linux-rel-css, linux-rel-wpt, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4...

@bors-servo
Copy link
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev
Approved by: SimonSapin
Pushing e7f4502 to master...

@bors-servo bors-servo merged commit a5a0e9f into servo:master Sep 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-tests-failed The changes caused existing tests to fail.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants