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

selectors: Get rid of hashing overhead using the precomputed hash atoms have. #16070

Merged
merged 2 commits into from Apr 8, 2017

Conversation

@emilio
Copy link
Member

emilio commented Mar 21, 2017

I realized of this when @bzbarsky mentioned the bloom filter in https://bugzilla.mozilla.org/show_bug.cgi?id=1348935#c7.

Right now we hash (the hash) all the time, when we can do better.

This requires a change in string-cache, which is at servo/string-cache#183.


This change is Reviewable

@highfive
Copy link

highfive commented Mar 21, 2017

Heads up! This PR modifies the following files:

  • @bholley: components/style/Cargo.toml, components/style/lib.rs, components/style/gecko_string_cache/mod.rs, components/style/gecko_string_cache/namespace.rs, components/style/matching.rs
@highfive
Copy link

highfive commented Mar 21, 2017

warning Warning warning

  • These commits modify style code, but no tests are modified. Please consider adding a test!
@emilio
Copy link
Member Author

emilio commented Mar 21, 2017

@bholley: Feedback on this? I'm not too happy enforcing PrecomputedHash everywhere, but it can be made a feature in the future if it's inconvenient for some reason.

@emilio
Copy link
Member Author

emilio commented Mar 21, 2017

Inconvenient for rust-selectors downstream users, I mean, for us it's fine.

.travis.yml Outdated
@@ -21,6 +21,7 @@ matrix:
- bash etc/ci/check_no_panic.sh
- bash etc/ci/lockfile_changed.sh
- bash etc/ci/manifest_changed.sh
- (cd components/selectors && cargo test)

This comment has been minimized.

@mbrubeck

mbrubeck Mar 21, 2017

Contributor

./mach cargo test -p selectors should work here

@bholley
Copy link
Contributor

bholley commented Mar 21, 2017

This approach seems fine. Thanks for fixing this emilio!

@@ -1201,6 +1201,8 @@ pub mod tests {
type PseudoElement = PseudoElement;
}

type ShutUpTidy = String;

This comment has been minimized.

@nox

nox Mar 25, 2017

Member

...What?

This comment has been minimized.

@emilio

emilio Mar 25, 2017

Author Member

(Tidy complains when it sees &String as a function argument, even if in this case is unavoidable because it's generic code).

This comment has been minimized.

@nox

nox Mar 25, 2017

Member

I see. You can probably do &<Self::Impl as SelectorImpl>::NamespacePrefix though.

@bors-servo
Copy link
Contributor

bors-servo commented Apr 5, 2017

The latest upstream changes (presumably #16169) made this pull request unmergeable. Please resolve the merge conflicts.

@emilio emilio force-pushed the emilio:selectors-bloom-hash-less branch 2 times, most recently from 5880fe7 to 6551d04 Apr 7, 2017
@emilio
Copy link
Member Author

emilio commented Apr 7, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Apr 7, 2017

Trying commit 6551d04 with merge 6ca38d5...

bors-servo added a commit that referenced this pull request Apr 7, 2017
selectors: Get rid of hashing overhead using the precomputed hash atoms have.

I realized of this when @bzbarsky  mentioned the bloom filter in https://bugzilla.mozilla.org/show_bug.cgi?id=1348935#c7.

Right now we hash (the hash) all the time, when we can do better.

This requires a change in string-cache, which is at servo/string-cache#183.

<!-- 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/16070)
<!-- Reviewable:end -->
@bzbarsky
Copy link
Contributor

bzbarsky commented Apr 7, 2017

@emilio Is this good to go?

@emilio
Copy link
Member Author

emilio commented Apr 7, 2017

@bzbarsky it should, it's currently waiting for review, yeah. I wanted to wait for the try run to report before that, but bors decided not to publish test results.

Needs a squash, but happy to land this if somebody signs it off :)

@emilio
Copy link
Member Author

emilio commented Apr 7, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Apr 7, 2017

Trying commit aae7984 with merge 1d3109b...

bors-servo added a commit that referenced this pull request Apr 7, 2017
selectors: Get rid of hashing overhead using the precomputed hash atoms have.

I realized of this when @bzbarsky  mentioned the bloom filter in https://bugzilla.mozilla.org/show_bug.cgi?id=1348935#c7.

Right now we hash (the hash) all the time, when we can do better.

This requires a change in string-cache, which is at servo/string-cache#183.

<!-- 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/16070)
<!-- Reviewable:end -->
@emilio
Copy link
Member Author

emilio commented Apr 7, 2017

r? @bholley

Leaving it in Bobby's queue, but if someone wants to steal it, please do :)

@highfive highfive assigned bholley and unassigned glennw Apr 7, 2017
@bholley
Copy link
Contributor

bholley commented Apr 7, 2017

@bors-servo delegate+

@bors-servo
Copy link
Contributor

bors-servo commented Apr 7, 2017

✌️ @emilio can now approve this pull request

@bors-servo
Copy link
Contributor

bors-servo commented Apr 7, 2017

💔 Test failed - linux-rel-wpt

@emilio
Copy link
Member Author

emilio commented Apr 7, 2017

@bors-servo r=bholley

That timeout looks unrelated.

@bors-servo
Copy link
Contributor

bors-servo commented Apr 7, 2017

📌 Commit aae7984 has been approved by bholley

@bors-servo
Copy link
Contributor

bors-servo commented Apr 7, 2017

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

@emilio
Copy link
Member Author

emilio commented Apr 7, 2017

@bors-servo r-

Whoops, the squash is missing though :)

emilio added 2 commits Mar 21, 2017
…loom filter.
…hes we have.
@emilio emilio force-pushed the emilio:selectors-bloom-hash-less branch from aae7984 to e29b84d Apr 8, 2017
@emilio
Copy link
Member Author

emilio commented Apr 8, 2017

@bors-servo r=bholley

@bors-servo
Copy link
Contributor

bors-servo commented Apr 8, 2017

📌 Commit e29b84d has been approved by bholley

@bors-servo
Copy link
Contributor

bors-servo commented Apr 8, 2017

Testing commit e29b84d with merge a811776...

bors-servo added a commit that referenced this pull request Apr 8, 2017
selectors: Get rid of hashing overhead using the precomputed hash atoms have.

I realized of this when @bzbarsky  mentioned the bloom filter in https://bugzilla.mozilla.org/show_bug.cgi?id=1348935#c7.

Right now we hash (the hash) all the time, when we can do better.

This requires a change in string-cache, which is at servo/string-cache#183.

<!-- 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/16070)
<!-- Reviewable:end -->
@emilio emilio mentioned this pull request Apr 8, 2017
2 of 2 tasks complete
@bors-servo
Copy link
Contributor

bors-servo commented Apr 8, 2017

☀️ 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-msvc-dev
Approved by: bholley
Pushing a811776 to master...

@bors-servo bors-servo merged commit e29b84d into servo:master Apr 8, 2017
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants
You can’t perform that action at this time.