Closed Bug 1311598 Opened 8 years ago Closed 8 years ago

Stylo: split ServoBindings.h into separate files to reduce compile time of adding binding functions

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: xidorn, Assigned: xidorn)

References

Details

Attachments

(4 files)

IIUC, in majority of times, ServoBindings.h is included in a header file just for the types and their traits defined there, and only a handful of files really need to know the binding functions. However, most of changes to this file are for adding / changing the binding functions, which leads to tons of unnecessary recompile. I think we can split ServoBindings.h into ServoBindingTypes.h and ServoBindings.h, and change majority of includes to just ServoBindingTypes.h.
So before this change, adding a binding function (touch ServoBindings.h) takes more than 10min to rebuild on my machine. After this change, it takes less than 1m30s.
Assignee: nobody → xidorn+moz
Comment on attachment 8803760 [details] Bug 1311598 part 1 - Move PropertyValuePair::operator== into cpp file. https://reviewboard.mozilla.org/r/87894/#review86870
Attachment #8803760 - Flags: review?(bbirtles) → review+
Comment on attachment 8803761 [details] Bug 1311598 part 2 - Declare Servo_GetStyle* functions in nsStyleContext.h. https://reviewboard.mozilla.org/r/87896/#review86888
Attachment #8803761 - Flags: review?(cam) → review+
Comment on attachment 8803762 [details] Bug 1311598 part 3 - Add include ServoBindings.h to files need it. https://reviewboard.mozilla.org/r/87898/#review86890
Attachment #8803762 - Flags: review?(cam) → review+
Comment on attachment 8803763 [details] Bug 1311598 part 4 - Split binding types from ServoBindings.h into ServoBindingTypes, and merge ServoBindingHelpers into it. https://reviewboard.mozilla.org/r/87900/#review86882 ::: servo/components/style/binding_tools/regen.py:243 (Diff revision 2) > "--ignore-methods", > ], > "match_headers": [ > "ServoBindingList.h", > "ServoBindings.h", > + "ServoBindingTyps.h", Does fixing the typo cause any difference to what gets generated? ::: servo/components/style/binding_tools/regen.py:249 (Diff revision 2) > "nsStyleStructList.h", > ], > "files": [ > "{}/dist/include/mozilla/ServoBindings.h", > ], > Nit: keep this blank just before the comment.
Attachment #8803763 - Flags: review?(cam) → review+
Comment on attachment 8803763 [details] Bug 1311598 part 4 - Split binding types from ServoBindings.h into ServoBindingTypes, and merge ServoBindingHelpers into it. https://reviewboard.mozilla.org/r/87900/#review86882 > Does fixing the typo cause any difference to what gets generated? Oops. Actually, no. That probably means I don't need this line at all.
Pushed by xquan@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/ef6a591da5f4 part 1 - Move PropertyValuePair::operator== into cpp file. r=birtles https://hg.mozilla.org/integration/mozilla-inbound/rev/32d31d45bc1c part 2 - Declare Servo_GetStyle* functions in nsStyleContext.h. r=heycam https://hg.mozilla.org/integration/mozilla-inbound/rev/b88f09bddf8e part 3 - Add include ServoBindings.h to files need it. r=heycam https://hg.mozilla.org/integration/mozilla-inbound/rev/5af7afe20e40 part 4 - Split binding types from ServoBindings.h into ServoBindingTypes, and merge ServoBindingHelpers into it. r=heycam
(In reply to Xidorn Quan [:xidorn] (UTC+10) from comment #11) > Comment on attachment 8803763 [details] > Bug 1311598 part 4 - Split binding types from ServoBindings.h into > ServoBindingTypes, and merge ServoBindingHelpers into it. > > https://reviewboard.mozilla.org/r/87900/#review86882 > > > Does fixing the typo cause any difference to what gets generated? > > Oops. Actually, no. That probably means I don't need this line at all. The `match_headers` thing is no longer used AFAIK, so you can drop them all and the generated output shouldn't change.
The Servo side change is servo/servo#13904.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: