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

Refactor attribute handling to avoid marshalling attributes from Gecko into Servo #11886

Merged
merged 11 commits into from Jul 6, 2016

Conversation

@bholley
Copy link
Contributor

bholley commented Jun 27, 2016

This marshaling is slow, because Gecko stores attributes as UTF-16 and does not atomize them in all cases, and it turns out that the need for them in Servo is pretty minimal. With some refactoring across servo and rust-selectors we can fix this.


This change is Reviewable

@highfive
Copy link

highfive commented Jun 27, 2016

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/element.rs, components/script_layout_interface/wrapper_traits.rs, components/script/layout_wrapper.rs
@highfive
Copy link

highfive commented Jun 27, 2016

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify style, layout, and script code, but no tests are modified. Please consider adding a test!
@bholley
Copy link
Contributor Author

bholley commented Jun 27, 2016

This isn't ready for review yet, but I want to test the rust-selectors changes.

@bors-servo try

bors-servo added a commit that referenced this pull request Jun 27, 2016
Refactor attribute handling to avoid marshalling attributes from Gecko into Servo

This marshaling is slow, because Gecko stores attributes as UTF-16 and does not atomize them in all cases, and it turns out that the need for them in Servo is pretty minimal. With some refactoring across servo and rust-selectors we can fix this.
@bors-servo
Copy link
Contributor

bors-servo commented Jun 27, 2016

Trying commit b92920d with merge 1bf0fd4...

@bors-servo
Copy link
Contributor

bors-servo commented Jun 27, 2016

💔 Test failed - linux-dev

@bholley bholley force-pushed the bholley:attr_refactor branch from b92920d to 44ee15e Jun 28, 2016
@bholley
Copy link
Contributor Author

bholley commented Jun 28, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Jun 28, 2016

Trying commit 44ee15e with merge 9bceb20...

bors-servo added a commit that referenced this pull request Jun 28, 2016
Refactor attribute handling to avoid marshalling attributes from Gecko into Servo

This marshaling is slow, because Gecko stores attributes as UTF-16 and does not atomize them in all cases, and it turns out that the need for them in Servo is pretty minimal. With some refactoring across servo and rust-selectors we can fix this.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11886)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 28, 2016

💔 Test failed - linux-dev

@cbrewster
Copy link
Member

cbrewster commented Jun 28, 2016

Tidy failure:

Checking files for tidiness...

./components/script/Cargo.toml:60: Line is longer than 120 characters

./components/style/Cargo.toml:36: Line is longer than 120 characters

./components/layout/Cargo.toml:34: Line is longer than 120 characters

./components/script_layout_interface/Cargo.toml:29: Line is longer than 120 characters

./tests/unit/style/Cargo.toml:16: Line is longer than 120 characters

./ports/geckolib/Cargo.toml:39: Line is longer than 120 characters
@bholley
Copy link
Contributor Author

bholley commented Jun 28, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Jun 28, 2016

Trying commit 8b7b2f7 with merge c16e5d7...

bors-servo added a commit that referenced this pull request Jun 28, 2016
Refactor attribute handling to avoid marshalling attributes from Gecko into Servo

This marshaling is slow, because Gecko stores attributes as UTF-16 and does not atomize them in all cases, and it turns out that the need for them in Servo is pretty minimal. With some refactoring across servo and rust-selectors we can fix this.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11886)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 28, 2016

💔 Test failed - linux-rel

@bors-servo
Copy link
Contributor

bors-servo commented Jun 28, 2016

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

@bors-servo
Copy link
Contributor

bors-servo commented Jul 6, 2016

💔 Test failed - linux-dev

heycam and others added 9 commits May 27, 2016
This should just be a helper.
If this is all the information the caller needs, we can get it from gecko without
worrying about atomization and string conversions.
Same reasons as the previous patch.
@bholley bholley force-pushed the bholley:attr_refactor branch from e370584 to 187a47d Jul 6, 2016
@bholley
Copy link
Contributor Author

bholley commented Jul 6, 2016

@bors-servo r=SimonSapin

@bors-servo
Copy link
Contributor

bors-servo commented Jul 6, 2016

📌 Commit 187a47d has been approved by SimonSapin

@bors-servo
Copy link
Contributor

bors-servo commented Jul 6, 2016

Testing commit 187a47d with merge abdf2f2...

bors-servo added a commit that referenced this pull request Jul 6, 2016
Refactor attribute handling to avoid marshalling attributes from Gecko into Servo

This marshaling is slow, because Gecko stores attributes as UTF-16 and does not atomize them in all cases, and it turns out that the need for them in Servo is pretty minimal. With some refactoring across servo and rust-selectors we can fix this.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11886)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 6, 2016

@bors-servo bors-servo merged commit 187a47d into servo:master Jul 6, 2016
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@Manishearth
Copy link
Member

Manishearth commented Jul 6, 2016

I rebased my stylo work to servo master, and it seems like the corresponding commits for this have not yet arrived in the master branch of gecko-dev, or anywhere else.

I found them in https://bugzilla.mozilla.org/show_bug.cgi?id=1283620 -- could we maintain a separate branch which always builds with servo on Github? i.e. whenever you update a bindings file and it lands, just cherry-pick the relevant gecko commits onto that branch. We can sync it when the commit lands in m-c.

@bholley
Copy link
Contributor Author

bholley commented Jul 6, 2016

could we maintain a separate branch which always builds with servo on Github?

Well, it's really a symmetric problem right? If we have a logical changeset that's split across the two repos, it may land first on s/s or m-c. In either case, you need to cherry-pick the corresponding changeset for one repo if you want to build tip on the other. Trying to maintain a "live" revision of one repo that builds with the tip of the other is also fraught - either you need one person always paying attention to every landing, or you need multiple people maintaining the branches, leading to coordination problems.

The best way I've come up with is to maintain two branches which are known to work with each other, which are the stylo branches. This is obviously not great, because sometimes I get behind and don't get the chance to fast-forward the branches and pick up all the changes (like what happened this week). But until we fix the repo problem, I'm not sure there's a better way. Luckily, that's happening now. :-)

@Manishearth
Copy link
Member

Manishearth commented Jul 7, 2016

Well, AIUI things land faster in Servo, and we could just hold off on starting the land process in Gecko until it gets r+d in servo. Or vice versa.

The "known good" branches should work if we're syncing enough. At the same time, I'm not very fond of landing changes on a Servo master when the changes can't actually be tested -- this is why I'm proposing an extra stylo_tip gecko-dev branch which everyone puts their commits on, with regular rebases and force-pushes.

@bholley bholley deleted the bholley:attr_refactor branch Aug 26, 2016
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.