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

remove extra clones from dom event script #14066

Merged
merged 1 commit into from Nov 6, 2016

Conversation

@ducks
Copy link
Contributor

ducks commented Nov 4, 2016

fixes #14062 by removing extra clone calls


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #14062 (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because elements are already copies

This change is Reviewable

@highfive
Copy link

highfive commented Nov 4, 2016

Heads up! This PR modifies the following files:

@highfive
Copy link

highfive commented Nov 4, 2016

warning Warning warning

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

nox left a comment

Thanks for your contribution! Just one nit.

let bubbles = self.bubbles.clone();
let cancelable = self.cancelable.clone();
let bubbles = self.bubbles;
let cancelable = self.cancelable;

This comment has been minimized.

@nox

nox Nov 4, 2016

Member

Nit: pass self.bubbles and self.cancelable directly instead of binding them to local variables.

This comment has been minimized.

@frewsxcv

frewsxcv Nov 4, 2016

Member

I moved them out because the borrow check was complaining that self was moved because of self.name in the next line.

This comment has been minimized.

@frewsxcv

frewsxcv Nov 4, 2016

Member

Relevant rustc issue: rust-lang/rust#16223

@ducks
Copy link
Contributor Author

ducks commented Nov 4, 2016

So I tried doing that but am getting errors with self being moved.

https://gist.github.com/rjgoldsborough/7146daab82378135a37e79ee3be5aee1

Doing a clone on that self.name first seems to fix it but dunno if that's much better?

heh yeah, what @frewsxcv just said :)

@ducks ducks force-pushed the ducks:remove-extra-clones-14062 branch from 1a0d903 to 20cf7c1 Nov 4, 2016
@ducks
Copy link
Contributor Author

ducks commented Nov 4, 2016

I pushed up a commit that clones the self.name.

Lemme know if there is a better fix and I will try to apply it.

@frewsxcv
Copy link
Member

frewsxcv commented Nov 4, 2016

We probably don't want to clone self.name. Cloning a type that implements Copy (self.bubbles and self.cancelable both implement Copy) is free. So, from what I understand, these are the same, performance wise:

let bubbles = self.bubbles.clone();
let bubbles = self.bubbles;

Cloning an Atom is cheap (just an atomic refcount bump), but it's not as cheap as cloning a Copy-type. So we should be fine with just your first commit.

@ducks ducks force-pushed the ducks:remove-extra-clones-14062 branch from 20cf7c1 to 5b22f85 Nov 4, 2016
@ducks
Copy link
Contributor Author

ducks commented Nov 4, 2016

Ah ok, cool. Rebased that commit out and repushed.

Thanks.

@frewsxcv
Copy link
Member

frewsxcv commented Nov 4, 2016

Thanks! 🎊

@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Nov 4, 2016

📌 Commit 5b22f85 has been approved by frewsxcv

@highfive highfive assigned frewsxcv and unassigned nox Nov 4, 2016
@frewsxcv
Copy link
Member

frewsxcv commented Nov 4, 2016

For more info about Copy, there's a bit of documentation here.

@ducks
Copy link
Contributor Author

ducks commented Nov 4, 2016

Thanks much

@bors-servo
Copy link
Contributor

bors-servo commented Nov 4, 2016

Testing commit 5b22f85 with merge bd2fae6...

bors-servo added a commit that referenced this pull request Nov 4, 2016
…ewsxcv

remove extra clones from dom event script

<!-- Please describe your changes on the following line: -->

fixes #14062 by removing extra clone calls
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14062  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because elements are already copies

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

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

bors-servo commented Nov 5, 2016

💔 Test failed - linux-rel-wpt

@highfive
Copy link

highfive commented Nov 5, 2016

  ▶ FAIL [expected PASS] /_mozilla/css/inline_block_opacity_change.html
  └   → /_mozilla/css/inline_block_opacity_change.html aed6845267bba6c52d3aa69c4889449b454d8117
/_mozilla/css/inline_block_opacity_change_ref.html febec1b4730afab195f280694dad47200b09ea3c
Testing aed6845267bba6c52d3aa69c4889449b454d8117 == febec1b4730afab195f280694dad47200b09ea3c
@nox
Copy link
Member

nox commented Nov 5, 2016

@highfive
Copy link

highfive commented Nov 5, 2016

  ▶ TIMEOUT [expected CRASH] /_mozilla/mozilla/sigsegv.html
  │ 
  │ VMware, </span><span class="stdout">Inc.
  │ Gallium 0.4 on softpipe
  └ 3.3 (Core Profile) Mesa 12.0.1
@frewsxcv
Copy link
Member

frewsxcv commented Nov 5, 2016

@frewsxcv frewsxcv dismissed nox’s stale review Nov 5, 2016

No longer applicable

@ducks
Copy link
Contributor Author

ducks commented Nov 5, 2016

Looking like this is a build thing but let me know if I can do anything.

@frewsxcv
Copy link
Member

frewsxcv commented Nov 5, 2016

No worries, you're not doing anything wrong, your changes are good. When running tests, Servo (unfortunately) encounters intermittent failures/passes, so we have to 'retry' builds regularly.

@bors-servo
Copy link
Contributor

bors-servo commented Nov 5, 2016

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

@ducks
Copy link
Contributor Author

ducks commented Nov 5, 2016

Cool. Yeah I've seen it on other issues but willing to jump in wherever.

@SimonSapin
Copy link
Member

SimonSapin commented Nov 5, 2016

Trying to get homu unstuck

@SimonSapin SimonSapin closed this Nov 5, 2016
@SimonSapin SimonSapin reopened this Nov 5, 2016
@SimonSapin SimonSapin closed this Nov 5, 2016
@SimonSapin SimonSapin reopened this Nov 5, 2016
@KiChjang KiChjang force-pushed the ducks:remove-extra-clones-14062 branch from 5b22f85 to c5f562a Nov 5, 2016
@KiChjang
Copy link
Member

KiChjang commented Nov 5, 2016

@bors-servo r=frewsxcv

@bors-servo
Copy link
Contributor

bors-servo commented Nov 5, 2016

📌 Commit c5f562a has been approved by frewsxcv

@bors-servo
Copy link
Contributor

bors-servo commented Nov 5, 2016

Testing commit c5f562a with merge 214e13e...

bors-servo added a commit that referenced this pull request Nov 5, 2016
…ewsxcv

remove extra clones from dom event script

<!-- Please describe your changes on the following line: -->

fixes #14062 by removing extra clone calls
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14062  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because elements are already copies

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

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

bors-servo commented Nov 5, 2016

The build was interrupted to prioritize another pull request.

@KiChjang
Copy link
Member

KiChjang commented Nov 6, 2016

@bors-servo retry clean

@bors-servo
Copy link
Contributor

bors-servo commented Nov 6, 2016

Testing commit c5f562a with merge bc9a8f5...

bors-servo added a commit that referenced this pull request Nov 6, 2016
…ewsxcv

remove extra clones from dom event script

<!-- Please describe your changes on the following line: -->

fixes #14062 by removing extra clone calls
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14062  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because elements are already copies

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

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

bors-servo commented Nov 6, 2016

@bors-servo bors-servo merged commit c5f562a into servo:master Nov 6, 2016
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
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.

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