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

Avoid debug serialization of PropertyDeclaration & co in release builds #19779

Merged
merged 1 commit into from Jan 16, 2018

Conversation

bholley
Copy link
Contributor

@bholley bholley commented Jan 15, 2018

In total, this PR saves ~60k.

The conditional compilation on the _Debug FFI function eliminates one
of the ToCss variants, eliminating 54.4k, as well as a bunch of other
<1k functions. Removing the public trait implementation of Debug for the
font metrics provider eliminates the last Debug impl from stylo.


This change is Reviewable

@highfive
Copy link

Heads up! This PR modifies the following files:

  • @canaltinova: components/style/font_metrics.rs
  • @emilio: ports/geckolib/glue.rs, components/style/font_metrics.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 15, 2018
@highfive
Copy link

warning Warning warning

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

Copy link
Member

@emilio emilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, that was an easy win. I bet way easier than finding it :)

@emilio
Copy link
Member

emilio commented Jan 15, 2018

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 903cf60 has been approved by emilio

@highfive highfive assigned emilio and unassigned glennw Jan 15, 2018
@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 Jan 15, 2018
@bors-servo
Copy link
Contributor

⌛ Testing commit 903cf60 with merge 3fb9f71...

bors-servo pushed a commit that referenced this pull request Jan 15, 2018
Avoid debug serialization of PropertyDeclaration & co in release builds

In total, this PR saves ~60k.

The conditional compilation on the _Debug FFI function eliminates one
of the ToCss variants, eliminating 54.4k, as well as a bunch of other
<1k functions. Removing the public trait implementation of Debug for the
font metrics provider eliminates the last Debug impl from stylo.

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

💔 Test failed - linux-rel-css

@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 Jan 16, 2018
@jdm
Copy link
Member

jdm commented Jan 16, 2018

error[E0425]: cannot find value `Servo_StyleRule_Debug` in this scope
  --> /home/servo/buildbot/slave/linux-rel-css/build/target/geckolib/release/build/stylo_tests-161c816f485961cf/out/check_bindings.rs:88:7
   |
88 |     [ Servo_StyleRule_Debug, bindings::Servo_StyleRule_Debug ];
   |       ^^^^^^^^^^^^^^^^^^^^^ did you mean `Servo_StyleRule_AddRef`?
   |
help: possible candidate is found in another module, you can import it into scope
   |
7  | use style::gecko_bindings::bindings::Servo_StyleRule_Debug;
   |

error[E0425]: cannot find value `Servo_ImportRule_Debug` in this scope
  --> /home/servo/buildbot/slave/linux-rel-css/build/target/geckolib/release/build/stylo_tests-161c816f485961cf/out/check_bindings.rs:91:7
   |
91 |     [ Servo_ImportRule_Debug, bindings::Servo_ImportRule_Debug ];
   |       ^^^^^^^^^^^^^^^^^^^^^^ did you mean `Servo_ImportRule_AddRef`?
   |
help: possible candidate is found in another module, you can import it into scope
   |
7  | use style::gecko_bindings::bindings::Servo_ImportRule_Debug;
   |

error[E0425]: cannot find value `Servo_Keyframe_Debug` in this scope
  --> /home/servo/buildbot/slave/linux-rel-css/build/target/geckolib/release/build/stylo_tests-161c816f485961cf/out/check_bindings.rs:93:7
   |
93 |     [ Servo_Keyframe_Debug, bindings::Servo_Keyframe_Debug ];
   |       ^^^^^^^^^^^^^^^^^^^^ did you mean `Servo_Keyframe_AddRef`?
   |
help: possible candidate is found in another module, you can import it into scope
   |
7  | use style::gecko_bindings::bindings::Servo_Keyframe_Debug;
   |

error[E0425]: cannot find value `Servo_KeyframesRule_Debug` in this scope
  --> /home/servo/buildbot/slave/linux-rel-css/build/target/geckolib/release/build/stylo_tests-161c816f485961cf/out/check_bindings.rs:96:7
   |
96 |     [ Servo_KeyframesRule_Debug, bindings::Servo_KeyframesRule_Debug ];
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^ did you mean `Servo_KeyframesRule_AddRef`?
   |
help: possible candidate is found in another module, you can import it into scope
   |
7  | use style::gecko_bindings::bindings::Servo_KeyframesRule_Debug;
   |

error[E0425]: cannot find value `Servo_MediaRule_Debug` in this scope
  --> /home/servo/buildbot/slave/linux-rel-css/build/target/geckolib/release/build/stylo_tests-161c816f485961cf/out/check_bindings.rs:99:7
   |
99 |     [ Servo_MediaRule_Debug, bindings::Servo_MediaRule_Debug ];
   |       ^^^^^^^^^^^^^^^^^^^^^ did you mean `Servo_MediaRule_AddRef`?
   |
help: possible candidate is found in another module, you can import it into scope
   |
7  | use style::gecko_bindings::bindings::Servo_MediaRule_Debug;
   |

error[E0425]: cannot find value `Servo_NamespaceRule_Debug` in this scope
   --> /home/servo/buildbot/slave/linux-rel-css/build/target/geckolib/release/build/stylo_tests-161c816f485961cf/out/check_bindings.rs:103:7
    |
103 |     [ Servo_NamespaceRule_Debug, bindings::Servo_NamespaceRule_Debug ];
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^ did you mean `Servo_NamespaceRule_GetURI`?
    |
help: possible candidate is found in another module, you can import it into scope
    |
7   | use style::gecko_bindings::bindings::Servo_NamespaceRule_Debug;
    |

error[E0425]: cannot find value `Servo_PageRule_Debug` in this scope
   --> /home/servo/buildbot/slave/linux-rel-css/build/target/geckolib/release/build/stylo_tests-161c816f485961cf/out/check_bindings.rs:106:7
    |
106 |     [ Servo_PageRule_Debug, bindings::Servo_PageRule_Debug ];
    |       ^^^^^^^^^^^^^^^^^^^^ did you mean `Servo_PageRule_AddRef`?
    |
help: possible candidate is found in another module, you can import it into scope
    |
7   | use style::gecko_bindings::bindings::Servo_PageRule_Debug;
    |

error[E0425]: cannot find value `Servo_SupportsRule_Debug` in this scope
   --> /home/servo/buildbot/slave/linux-rel-css/build/target/geckolib/release/build/stylo_tests-161c816f485961cf/out/check_bindings.rs:109:7
    |
109 |     [ Servo_SupportsRule_Debug, bindings::Servo_SupportsRule_Debug ];
    |       ^^^^^^^^^^^^^^^^^^^^^^^^ did you mean `Servo_SupportsRule_AddRef`?
    |
help: possible candidate is found in another module, you can import it into scope
    |
7   | use style::gecko_bindings::bindings::Servo_SupportsRule_Debug;
    |

error[E0425]: cannot find value `Servo_DocumentRule_Debug` in this scope
   --> /home/servo/buildbot/slave/linux-rel-css/build/target/geckolib/release/build/stylo_tests-161c816f485961cf/out/check_bindings.rs:113:7
    |
113 |     [ Servo_DocumentRule_Debug, bindings::Servo_DocumentRule_Debug ];
    |       ^^^^^^^^^^^^^^^^^^^^^^^^ did you mean `Servo_DocumentRule_AddRef`?
    |
help: possible candidate is found in another module, you can import it into scope
    |
7   | use style::gecko_bindings::bindings::Servo_DocumentRule_Debug;
    |

error[E0425]: cannot find value `Servo_FontFeatureValuesRule_Debug` in this scope
   --> /home/servo/buildbot/slave/linux-rel-css/build/target/geckolib/release/build/stylo_tests-161c816f485961cf/out/check_bindings.rs:117:7
    |
117 |     [ Servo_FontFeatureValuesRule_Debug, bindings::Servo_FontFeatureValuesRule_Debug ];
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ did you mean `Servo_FontFeatureValuesRule_AddRef`?
    |
help: possible candidate is found in another module, you can import it into scope
    |
7   | use style::gecko_bindings::bindings::Servo_FontFeatureValuesRule_Debug;

In total, this PR saves ~60k.

The conditional compilation on the _Debug FFI function eliminates one
of the ToCss variants, eliminating 54.4k, as well as a bunch of other
<1k functions. Removing the public trait implementation of Debug for the
font metrics provider eliminates the last Debug impl from stylo.

MozReview-Commit-ID: nIfQ3sy4OW
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Jan 16, 2018
@bholley
Copy link
Contributor Author

bholley commented Jan 16, 2018

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

📌 Commit 9a8821a has been approved by emilio

@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 Jan 16, 2018
@bors-servo
Copy link
Contributor

⌛ Testing commit 9a8821a with merge 7de87c4...

bors-servo pushed a commit that referenced this pull request Jan 16, 2018
Avoid debug serialization of PropertyDeclaration & co in release builds

In total, this PR saves ~60k.

The conditional compilation on the _Debug FFI function eliminates one
of the ToCss variants, eliminating 54.4k, as well as a bunch of other
<1k functions. Removing the public trait implementation of Debug for the
font metrics provider eliminates the last Debug impl from stylo.

<!-- 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/19779)
<!-- Reviewable:end -->
@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: emilio
Pushing 7de87c4 to master...

@bors-servo bors-servo merged commit 9a8821a into servo:master Jan 16, 2018
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jan 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants