59 bytes, text/x-review-board-request
16.91 KB, 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 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+
Yeah, I think I checked that, but I should recheck it.
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/5eaa657f6e06 Make some fields in xpt_struct.h private. r=njn
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
Oops. I didn't think about the fact that one mandatory and one optional argument would mean the implicit/explicit stuff was in play...
Err, two optional arguments.
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/e5f7b0762928 Make some fields in xpt_struct.h private. r=njn
I was looking at perfherder, and it seems like this may have caused a big installer size regression. Very odd.
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...
Are you sure that new code got compiled into straight data, rather than some giant static constructor(s)?
(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.
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.
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.
(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.
Please land the backout patch I just attached. I checked it locally to make sure it builds and runs.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
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.
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.
Yeah, I agree.
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.
That's alright. I agree that it would be better if those fields were private.
Pushed https://hg.mozilla.org/integration/mozilla-inbound/rev/09c9390d42d6 Back out bug 1448454 for compile time and installer size regressions. r=mccr8
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
Somebody can try again if MSVC gets better.
Status: REOPENED → RESOLVED
Closed: Last year → Last year
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.