Closed
Bug 655003
Opened 14 years ago
Closed 13 years ago
Sort out optimization defaults
Categories
(Firefox Build System :: General, defect)
Tracking
(firefox6+ fixed)
RESOLVED
FIXED
mozilla7
People
(Reporter: glandium, Assigned: glandium)
References
Details
(Keywords: memory-footprint, perf, regression, Whiteboard: [landed m-c 6/15] [-O3 on PGO builds & -Os normal builds])
Attachments
(1 file, 3 obsolete files)
(deleted),
patch
|
christian
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
In bug 590181, we had unconditionally enabled aggressive optimization -O3 for everyone using gcc. It's probably not so good an idea, for several reasons:
- -O3 is known to be problematic on some older gcc versions
- -O3 is known to be problematic with gcc 4.5 (bug 654858)
- -O3 makes libxul.so 7MB bigger, increasing cold startup time
However, the main advantage of -O3 is to be a better aggressive optimization for PGO.
We should probably keep -Os as before by default and only enable -O3 when building with PGO.
Assignee | ||
Comment 1•14 years ago
|
||
Something to maybe keep in mind at some point: there are a bunch of nice wins with -O3 on n900...
Assignee | ||
Comment 2•14 years ago
|
||
Just a thought, maybe we could have some kind of extension of the --enable-optimize flag.
Assignee | ||
Comment 3•14 years ago
|
||
Note that the js/src part is actually mostly useless because js/src/Makefile.in defines MODULE_OPTIMIZE_FLAGS, and it's been a while it's been using -O3 unconditionally.
Attachment #532900 -
Flags: review?(ted.mielczarek)
Comment 4•14 years ago
|
||
I filed bug 464328 ages ago to get all that junk out of js/src/Makefile and just make it set things in configure.
Assignee | ||
Comment 5•14 years ago
|
||
On the other hand, doing so would mean using the defaults from the patch here, meaning that without PGO we'd start building with -Os, vs. -O3 previously. That could have a significant impact on performance, though it hasn't been measured.
But since we've been building with -O3 for a while in js/src, maybe we simply don't want to change anything there yet.
Comment 6•14 years ago
|
||
Well sure, but if we're going to have -O3 as the default, we ought to just set it in configure instead of in the Makefile.
Updated•14 years ago
|
Assignee: nobody → mh+mozilla
Comment 7•14 years ago
|
||
Comment on attachment 532900 [details] [diff] [review]
On Linux, use -Os on normal builds and -O3 when PGO is enabled
Review of attachment 532900 [details] [diff] [review]:
-----------------------------------------------------------------
r+ with one quibble.
::: config/autoconf.mk.in
@@ +315,5 @@
>
> WARNINGS_AS_ERRORS = @WARNINGS_AS_ERRORS@
>
> MOZ_OPTIMIZE = @MOZ_OPTIMIZE@
> +MOZ_OPTIMIZE_FLAGS = $(if $(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE),@MOZ_PGO_OPTIMIZE_FLAGS@,@MOZ_OPTIMIZE_FLAGS@)
I think this probably belongs in config.mk. autoconf.mk should stay as simple assignments of substituted values. This might mean you'll have to include config.mk in js/src/Makefile.in to use the right value there.
Attachment #532900 -
Flags: review?(ted.mielczarek) → review+
Assignee | ||
Comment 8•14 years ago
|
||
Something like this?
(config.mk is included from rules.mk, which is included in js/src/Makefile.in before using MOZ_OPTIMIZE_FLAGS)
Attachment #533642 -
Flags: review?(ted.mielczarek)
Assignee | ||
Updated•14 years ago
|
Attachment #532900 -
Attachment is obsolete: true
Comment 9•14 years ago
|
||
Comment on attachment 533642 [details] [diff] [review]
On Linux, use -Os on normal builds and -O3 when PGO is enabled
Review of attachment 533642 [details] [diff] [review]:
-----------------------------------------------------------------
Attachment #533642 -
Flags: review?(ted.mielczarek) → review+
Assignee | ||
Comment 10•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla6
Comment 11•14 years ago
|
||
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla6 → ---
Assignee | ||
Comment 12•14 years ago
|
||
The case where MOZ_PGO_OPTIMIZE_FLAGS isn't defined was deadly :(
Pushed to try:
http://tbpl.mozilla.org/?tree=Try&rev=2b2a0ac3a165
Attachment #534812 -
Flags: review?(ted.mielczarek)
Assignee | ||
Updated•14 years ago
|
Attachment #533642 -
Attachment is obsolete: true
Assignee | ||
Comment 13•14 years ago
|
||
We need this in Firefox 6, except if we want to allow Linux distros that build without PGO enabled to ship with bug 654858. We also want this because maemo builds were switched to -O3 as an unexpected side effect, but there is not enough test coverage to assess that it's not subject to similar problems, thus going back to -Os would be safer.
tracking-firefox6:
--- → ?
Comment 15•14 years ago
|
||
Requesting re-evaluation for 6.
(Perhaps it wasn't clear that currently we have regressions on 6 from bug 590181 and this bug tracks doing something about those regressions.)
Bug 659528 covers the broken tracking-firefox6 flag.
Updated•14 years ago
|
Keywords: regression
Comment 17•14 years ago
|
||
The regressions were fairly minor rendering artifacts in a few SVG reftests, right? If that's all it is, that seems like something we can live with. (Especially since they won't show up in our release builds, only non-PGO builds.)
Assignee | ||
Comment 18•14 years ago
|
||
(In reply to comment #17)
> only non-PGO builds.
Being what most linux distros ship, including Ubuntu.
Comment 19•14 years ago
|
||
The layout regressions are not understood, so I can't comment.
The start-up time regression would be significant.
There's also a footprint regression.
Updated•14 years ago
|
Whiteboard: nomination at comment 15
Updated•14 years ago
|
Comment 20•14 years ago
|
||
Comment on attachment 534812 [details] [diff] [review]
On Linux, use -Os on normal builds and -O3 when PGO is enabled.
Review of attachment 534812 [details] [diff] [review]:
-----------------------------------------------------------------
::: config/config.mk
@@ +421,5 @@
> ifdef MODULE_OPTIMIZE_FLAGS
> CFLAGS += $(MODULE_OPTIMIZE_FLAGS)
> CXXFLAGS += $(MODULE_OPTIMIZE_FLAGS)
> else
> +ifneq (,$(if $(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE),$(MOZ_PGO_OPTIMIZE_FLAGS)))
Can you add a comment here explaining what this is testing? It's not very easy to read.
Attachment #534812 -
Flags: review?(ted.mielczarek) → review+
Assignee | ||
Comment 21•13 years ago
|
||
Refreshed (context changes)
Assignee | ||
Updated•13 years ago
|
Attachment #534812 -
Attachment is obsolete: true
Assignee | ||
Comment 22•13 years ago
|
||
http://hg.mozilla.org/integration/mozilla-inbound/rev/e92f98e8a335
Normally, I'd have pushed on b-s, but we don't have talos coverage there.
Whiteboard: nomination at comment 15 → [inbound] nomination at comment 15
Assignee | ||
Comment 23•13 years ago
|
||
(In reply to comment #22)
> http://hg.mozilla.org/integration/mozilla-inbound/rev/e92f98e8a335
Wrong one, that was meant to be
http://hg.mozilla.org/integration/mozilla-inbound/rev/6df0ad2d1df2
Comment 24•13 years ago
|
||
I merged this from m-i to m-c, but it will be backed out shortly while we investigate Talos regressions:
http://hg.mozilla.org/mozilla-central/rev/6df0ad2d1df2
Comment 25•13 years ago
|
||
Correction; this landed on m-c and was not backed out.
Status: REOPENED → RESOLVED
Closed: 14 years ago → 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
Updated•13 years ago
|
Whiteboard: [inbound] nomination at comment 15 → nomination at comment 15
Assignee | ||
Updated•13 years ago
|
Attachment #539440 -
Flags: approval-mozilla-beta?
Updated•13 years ago
|
Whiteboard: nomination at comment 15 → [landed m-c 6/15] [-O3 on PGO builds & -Os normal builds]
Comment 26•13 years ago
|
||
(In reply to comment #17)
> The regressions were fairly minor rendering artifacts in a few SVG reftests,
> right? If that's all it is, that seems like something we can live with.
> (Especially since they won't show up in our release builds, only non-PGO
> builds.)
(In reply to comment #19)
> The layout regressions are not understood, so I can't comment.
>
> The start-up time regression would be significant.
> There's also a footprint regression.
Discussed in triage here, and we need some help. Is this effectively NPOTB for our official builds, since we are PGO on Linux? If so, why would we rush-land this on beta, versus just letting distros that disable PGO apply this patch as well, and getting it out the door ourselves in the Firefox 7 train?
NPOTB makes the risk profile much nicer if we do need to crashland it, but also feels like it reduces the urgency there, since it only helps people who are already custom-patching our code (and could presumably take this patch, too).
Assignee | ||
Comment 27•13 years ago
|
||
(In reply to comment #26)
> (In reply to comment #17)
> > The regressions were fairly minor rendering artifacts in a few SVG reftests,
> > right? If that's all it is, that seems like something we can live with.
> > (Especially since they won't show up in our release builds, only non-PGO
> > builds.)
>
> (In reply to comment #19)
> > The layout regressions are not understood, so I can't comment.
> >
> > The start-up time regression would be significant.
> > There's also a footprint regression.
>
> Discussed in triage here, and we need some help. Is this effectively NPOTB
> for our official builds, since we are PGO on Linux?
Yes
> If so, why would we
> rush-land this on beta, versus just letting distros that disable PGO apply
> this patch as well, and getting it out the door ourselves in the Firefox 7
> train?
How do you make sure they (all) do?
Comment 28•13 years ago
|
||
Note that we're using this patch in Ubuntu already, because we just can't absorb the size increase that -O3 causes at the moment
Comment 29•13 years ago
|
||
This hits the current Thunderbird beta pretty hard too, and this isn't built with PGO on Linux. With everything under mozilla/ getting built with -O3, the current download is more than 2MB bigger than the 5.0 release
Comment 30•13 years ago
|
||
(In reply to comment #26)
> NPOTB makes the risk profile much nicer if we do need to crashland it, but
> also feels like it reduces the urgency there, since it only helps people who
> are already custom-patching our code (and could presumably take this patch,
> too).
I agree with Chris that it would seem to affect Thunderbird, SeaMonkey and other xulrunner based apps that don't build with PGO. Increasing startup time isn't something we want to do unnecessarily.
Also xref comment 13 about maemo.
Comment 31•13 years ago
|
||
Comment on attachment 539440 [details] [diff] [review]
On Linux, use -Os on normal builds and -O3 when PGO is enabled.
Approving as this is generally NBOTB for official releases
Attachment #539440 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Assignee | ||
Comment 32•13 years ago
|
||
status-firefox6:
--- → fixed
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•