Closed
Bug 1448454
Opened 7 years ago
Closed 7 years ago
Make more fields private in xpt_struct.h
Categories
(Core :: XPCOM, enhancement)
Core
XPCOM
Tracking
()
RESOLVED
WONTFIX
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: mccr8, Unassigned)
References
Details
Attachments
(2 files)
(deleted),
text/x-review-board-request
|
n.nethercote
:
review+
|
Details |
(deleted),
patch
|
Details | Diff | Splinter Review |
Bug 1438688 changes many fields of the data structures in xpt_struct.h to be accessed only via accessors. These fields should be made private. This will require defining and using constexpr constructors for the classes, instead of aggregate initialization. Once somebody writes a patch, they will need to double check that all of the data structures in the generated code are still rodata.
Comment hidden (mozreview-request) |
Comment 2•7 years ago
|
||
mozreview-review |
Comment on attachment 8964579 [details]
Bug 1448454 - Make some fields in xpt_struct.h private.
https://reviewboard.mozilla.org/r/233294/#review239034
r=me if the tables are still rodata.
Attachment #8964579 -
Flags: review?(n.nethercote) → review+
Reporter | ||
Comment 3•7 years ago
|
||
Yeah, I think I checked that, but I should recheck it.
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5eaa657f6e06
Make some fields in xpt_struct.h private. r=njn
Comment 5•7 years ago
|
||
Backed out for build bustages at /builds/worker/workspace/build/src/xpcom/typelib/xpt/xpt_struct.h:16
Push that started the failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=5eaa657f6e06a62072c04c9f233f4e4508c15f51
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=171754031&repo=autoland&lineNumber=8251
Backout: https://hg.mozilla.org/integration/autoland/rev/7d7ad254494eee551d26aafb9fc44906679480e6
Flags: needinfo?(continuation)
Reporter | ||
Comment 6•7 years ago
|
||
Oops. I didn't think about the fact that one mandatory and one optional argument would mean the implicit/explicit stuff was in play...
Flags: needinfo?(continuation)
Reporter | ||
Comment 7•7 years ago
|
||
Err, two optional arguments.
Comment hidden (mozreview-request) |
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e5f7b0762928
Make some fields in xpt_struct.h private. r=njn
Comment 10•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Reporter | ||
Comment 11•7 years ago
|
||
I was looking at perfherder, and it seems like this may have caused a big installer size regression. Very odd.
Reporter | ||
Comment 12•7 years ago
|
||
It may have also regressed compile time on Windows by about 8%, which seems bad. Maybe MSVC just is not very fast at compiling a 26000 line file full of constexpr constructors...
Comment 13•7 years ago
|
||
Are you sure that new code got compiled into straight data, rather than some giant static constructor(s)?
Flags: needinfo?(continuation)
Reporter | ||
Comment 14•7 years ago
|
||
(In reply to Nathan Froyd [:froydnj] from comment #13)
> Are you sure that new code got compiled into straight data, rather than some
> giant static constructor(s)?
I don't know how to check that. I checked that on Linux that the various arrays were all still in .rodata.
Flags: needinfo?(continuation)
Comment 15•7 years ago
|
||
One option might be to paste some of the generated code into https://gcc.godbolt.org/ and see what it compiles to. The other option is to actually look at an MSVC build tree somehow and see what the relevant .obj looks like.
Comment 16•7 years ago
|
||
this change looks to have caused a build time regression:
== Change summary for alert #12502 (as of Wed, 04 Apr 2018 20:49:08 GMT) ==
Regressions:
8% build times windows2012-32 pgo taskcluster-c4.4xlarge 4,538.91 -> 4,917.75
5% build times windows2012-64 pgo taskcluster-c4.4xlarge 4,530.61 -> 4,766.80
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=12502
I am not 100% sure if this is the cause, but looking at the related graphs seems to highlight the patch from here.
Reporter | ||
Comment 17•7 years ago
|
||
(In reply to Joel Maher ( :jmaher) (UTC-5) from comment #16)
> I am not 100% sure if this is the cause, but looking at the related graphs
> seems to highlight the patch from here.
Yeah, the version of MSVC we're using seems to not deal with constexprs very well, so it is plausible. Between this and (more importantly) the installer size regression I see I think this should get backed out. I don't think there's a lot of danger that people are going to start poking around in these data structures, as it is very obscure. Maybe Nika's approach in bug 1444745 will work better.
Reporter | ||
Comment 18•7 years ago
|
||
Reporter | ||
Comment 19•7 years ago
|
||
Please land the backout patch I just attached. I checked it locally to make sure it builds and runs.
Reporter | ||
Comment 20•7 years ago
|
||
The installer size regression looks like this:
59,119,719.00 (lower is better)
Δ 180,407.00 (0.3%)
175kb isn't the end of the world I guess, if there was a stronger reason for taking it.
Comment 21•7 years ago
|
||
175K of *installer* size probably translates to something like 250-300K of libxul size (perfherder will tell you if you click the "include subtests" checkbox and search for "xul" to find the appropriate timeseries)...which is quite large. Unless there was a *really* good reason for needing the feature, a cleanup patch that regresses installer size by 175K is not acceptable.
Reporter | ||
Comment 22•7 years ago
|
||
Yeah, I agree.
Comment 23•7 years ago
|
||
I apologize for suggesting this change in the first place. It's a good example of what looks like a zero-cost abstraction but actually isn't.
Reporter | ||
Comment 24•7 years ago
|
||
That's alright. I agree that it would be better if those fields were private.
Comment 25•7 years ago
|
||
Pushed https://hg.mozilla.org/integration/mozilla-inbound/rev/09c9390d42d6
Back out bug 1448454 for compile time and installer size regressions. r=mccr8
Updated•7 years ago
|
Keywords: checkin-needed
Comment 26•7 years ago
|
||
backout shows build time improvements:
== Change summary for alert #12618 (as of Tue, 10 Apr 2018 05:08:57 GMT) ==
Improvements:
5% build times windows2012-64 pgo taskcluster-c4.4xlarge 4,796.76 -> 4,567.30
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=12618
Reporter | ||
Updated•7 years ago
|
Assignee: continuation → nobody
Reporter | ||
Comment 27•7 years ago
|
||
Somebody can try again if MSVC gets better.
Status: REOPENED → RESOLVED
Closed: 7 years ago → 7 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•