Please compile Firefox with PGO optimizations

Bug #213708 reported by Sorin Ionescu
240
This bug affects 42 people
Affects Status Importance Assigned to Milestone
XULRunner
Fix Released
Medium
firefox (Ubuntu)
Fix Released
Wishlist
Unassigned
Declined for Jaunty by Alexander Sack
Declined for Karmic by Chris Coulson
Declined for Lucid by Chris Coulson
Quantal
Won't Fix
Wishlist
Unassigned
firefox-3.0 (openSUSE)
New
Undecided
Unassigned
xulrunner (Debian)
New
Unknown

Bug Description

Binary package hint: xulrunner-1.9

I've been using Arch Linux for the last 3 months. Now, I'm back on Ubuntu because I got tired of configuring. Configuring never ends. However, for Arch Linux, I made the best Firefox 3 package ( http://aur.archlinux.org/packages.php?ID=15184 ), which includes PGO optimizations ( http://developer.mozilla.org/en/docs/Building_with_Profile-Guided_Optimization ).

The Windows version is PGO optimised. People will hate the Ubuntu version knowing that the Windows version is so much faster. The official mozilla nightlies are PGO optimised.

This was a test I did on Arch Linux, which is compiled against i686:
Firefox 3 Beta 3 on the left.
Firefox 3 Beta 4 with Profile Guided Optimisations on the right: http://www.paste2.org/p/15666

This is what I got with this build https://bugs.launchpad.net/gutsy-backports/+bug/212468

http://tinyurl.com/6fv8aq

7 times slower. I'm not sure how much i686 helps. But, my i686 PGO was 3 times faster than my normal i686.

There are no regressions. It just works.

I've attached how it was compiled and the mozconfig.

Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

This was actually ok before bug 361343. There was another older bug where I made the existing PGO support work again.

Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

Created an attachment (id=304838)
enable pgo on fx-linux-tbox

There you go.

Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

Created an attachment (id=304854)
with clobbery

So, this is going to be an unpopular change, I think we need to make it clobber as well.

Revision history for this message
In , Joduinn (joduinn) wrote :

From offline discussions with Damon, RobSayre, and then Ted:

1) This is being proposed for nightly/clobber builds, as well as hourly/incremental builds as well as release builds.

2) There are similar changes required for Mac. Ted is filing a bug for that.

3) This double-compile process will take extra time to cycle a build; seems like linux would be 2x, win32 would be just under 2x. This will need to be communicated to everyone watching Tinderbox.

4) We are not blocked on bug#418896 or bug#418894.

Revision history for this message
In , Joduinn (joduinn) wrote :

marking P1 as its needed for beta4.

Revision history for this message
In , RobertSayre (sayrer) wrote :

I had to back this out because of the following error:

/builds/tinderbox/Fx-Trunk/Linux_2.6.18-8.el5_Depend/mozilla/memory/jemalloc/jemalloc.c: In function 'choose_arena':
/builds/tinderbox/Fx-Trunk/Linux_2.6.18-8.el5_Depend/mozilla/memory/jemalloc/jemalloc.c:6043: error: corrupted profile info: edge from 5 to 6 exceeds maximal count
gmake[4]: *** [jemalloc.o] Error 1

Revision history for this message
In , RobertSayre (sayrer) wrote :

Looks like this might be just jemalloc causing problems. We should be able to skip PGO for that.

Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

Created an attachment (id=305385)
skip PGO in jemalloc

This should do it.

Revision history for this message
In , Benjamin Smedberg (Mozilla) [:bs] (benjamin-smedbergs) wrote :

(From update of attachment 305385)
File a followup? I imagine PGO for jemalloc would useful if simply for branch-prediction/locality optimizations.

Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

(From update of attachment 305385)
Filed bug 419470, will mention it in a comment.

Revision history for this message
In , Dsicore (dsicore) wrote :

(From update of attachment 305385)
a1.9+=damons

Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

(From update of attachment 305385)
sayrer: you should be clear to try this again, but given that we're freezing tomorrow night, it might be rough to do it before wednesday.

Revision history for this message
In , Beltzner (beltzner) wrote :

Do you guys need a clean window to do this, like with Windows?

Revision history for this message
In , RobertSayre (sayrer) wrote :

(In reply to comment #13)
> Do you guys need a clean window to do this, like with Windows?

That would be best, but I don't think it's critical we do it this week. Our best avenue for beta linux users seems to be distro betas. So I'm content to focus on mac and additional Windows profile input for the rest of this week.

Revision history for this message
In , Beltzner (beltzner) wrote :

(From update of attachment 304854)
a=beltzner for after beta 4

Revision history for this message
In , Joduinn (joduinn) wrote :

*** Bug 384899 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Joduinn (joduinn) wrote :

(In reply to comment #15)
> (From update of attachment 304854 [details])
> a=beltzner for after beta 4

Therefore, removing as blocker on bug#418926 (3.0beta4 tracking bug)

Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

Rob: do you want to do this? This has been sort of hanging out here for a while.

Revision history for this message
In , Mtschrep (mtschrep) wrote :

Given limited time in the release we are punting pgo on mac and linux - let's pick this up in next release

Revision history for this message
Sorin Ionescu (sorin.ionescu-deactivatedaccount) wrote : Please compile it with PGO optimizations

Binary package hint: xulrunner-1.9

I've been using Arch Linux for the last 3 months. Now, I'm back on Ubuntu because I got tired of configuring. Configuring never ends. However, for Arch Linux, I made the best Firefox 3 package ( http://aur.archlinux.org/packages.php?ID=15184 ), which includes PGO optimizations ( http://developer.mozilla.org/en/docs/Building_with_Profile-Guided_Optimization ).

The Windows version is PGO optimised. People will hate the Ubuntu version knowing that the Windows version is so much faster. The official mozilla nightlies are PGO optimised.

This was a test I did on Arch Linux, which is compiled against i686:
Firefox 3 Beta 3 on the left.
Firefox 3 Beta 4 with Profile Guided Optimisations on the right: http://www.paste2.org/p/15666

This is what I got with this build https://bugs.launchpad.net/gutsy-backports/+bug/212468

http://tinyurl.com/6fv8aq

7 times slower. I'm not sure how much i686 helps. But, my i686 PGO was 3 times faster than my normal i686.

There are no regressions. It just works.

description: updated
Revision history for this message
Sorin Ionescu (sorin.ionescu-deactivatedaccount) wrote :
Murat Gunes (mgunes)
Changed in xulrunner-1.9:
importance: Undecided → Wishlist
Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

(From update of attachment 304854)
Clearing approval flag to get this off the radar.

Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

(From update of attachment 305385)
Clearing approval flag to get this off the radar.

Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

We may take this in 3.next.

Revision history for this message
Simon Strandman (nejsimon) wrote : Re: Please compile it with PGO optimizations

Building firefox with PGO is actually quite simple. Just add "mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'" to mozconfig (profileserver.py is a script that runs the app) and run make with the "profiledbuild" target instead of "build".

Please enable this in Jaunty!

Revision history for this message
John Vivirito (gnomefreak) wrote :

nxsty,
Please feel free to build it with PGO and if it works after testing it please feel free to offer a debdiff or join us in #ubuntu-mozillateam on irc.freenode.net and talk to one of us about it and we can see if it is agreed opon

Changed in xulrunner-1.9:
status: New → Incomplete
Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

I wouldn't block on it, though.

Revision history for this message
In , Bzbarsky (bzbarsky) wrote :

So I just tried compiling with pgo on Linux. I get:

../../../../db/morkreader/libmorkreader_s.a(nsMorkReader.o): In function `global constructors keyed to 65535_0_nsMorkReader.cpp':
/home/bzbarsky/mozilla/debug/mozilla/db/morkreader/nsMorkReader.cpp:579: undefined reference to `__gcov_init'
../../../../db/morkreader/libmorkreader_s.a(nsMorkReader.o):(.data.rel+0x24): undefined reference to `__gcov_merge_add'
../../../../db/morkreader/libmorkreader_s.a(nsMorkReader.o):(.data.rel+0x30): undefined reference to `__gcov_merge_single'
../../../../db/morkreader/libmorkreader_s.a(nsMorkReader.o):(.data.rel+0x3c): undefined reference to `__gcov_merge_single'
../../../../db/morkreader/libmorkreader_s.a(nsMorkReader.o):(.data.rel+0x48): undefined reference to `__gcov_merge_add'
../../../../db/morkreader/libmorkreader_s.a(nsMorkReader.o):(.data.rel+0x54): undefined reference to `__gcov_merge_ior'
/home/bzbarsky/mozilla/debug/obj-firefox-gpo/dist/lib/libunicharutil_s.a(nsUnicharUtils.o): In function `global constructors keyed to 65535_0_nsUnicharUtils.cpp':
/home/bzbarsky/mozilla/debug/obj-firefox-gpo/intl/unicharutil/util/internal/nsUnicharUtils.cpp:226: undefined reference to `__gcov_init'
/home/bzbarsky/mozilla/debug/obj-firefox-gpo/dist/lib/libunicharutil_s.a(nsUnicharUtils.o):(.data.rel+0x24): undefined reference to `__gcov_merge_add'
/home/bzbarsky/mozilla/debug/obj-firefox-gpo/dist/lib/libunicharutil_s.a(nsUnicharUtils.o):(.data.rel+0x30): undefined reference to `__gcov_merge_single'
collect2: ld returned 1 exit status
gmake[7]: *** [libplaces.so] Error 1

Revision history for this message
In , Reed Loden (reed) wrote :

I think Murali was using gcov on Linux lately... maybe he can give some pointers?

Revision history for this message
In , Murali Nandigama (mnandigama) wrote :

Preliminary symptoms seems to be issues with LDFLAGS.

I need to check the .mozconfig file to comment further.

Revision history for this message
In , Reed Loden (reed) wrote :

bz, please post your .mozconfig for Murali, as per comment #26.

Revision history for this message
In , Bzbarsky (bzbarsky) wrote :

Created an attachment (id=362727)
The mozconfig in question

I had to do some manual copy/paste inclusion (I assumed you didn't want me to attach the 4-5 mozconfig files involved that include each other), and I removed all the comment lines. Other than that, this is the mozconfig involved.

Building on FC9 with:

% g++ --version
g++ (GCC) 4.3.0 20080428 (Red Hat 4.3.0-8)
% ld --version
GNU ld version 2.18.50.0.6-7.fc9 20080403

and ccache enabled.

Revision history for this message
In , Murali Nandigama (mnandigama) wrote :

Please add the following line to your .mozconfig file

export LDFLAGS="-lgcov -static-libgcc"

However, on a separate note, you are using '-g' flag for CFLAGS and CXXFLAGS and also using 'disable-debug'. Is it by design.

Thanks
Murali

Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

Last time I tried this (with an older GCC, definitely not 4.3) it didn't require any special mozconfig hacking. It's possible gcc just sucks.

Revision history for this message
In , Bzbarsky (bzbarsky) wrote :

> export LDFLAGS="-lgcov -static-libgcc"

I can try that, but sounds like https://developer.mozilla.org/en/Building_with_Profile-Guided_Optimization needs updating. Or the build target should perhaps handle this automatically.

AS for -g and --disable-debug, yes. I want to be able to have debug symbols in my optimized builds, both for crash stacks and actual debugging of issues that only show up in the optimized build.

Revision history for this message
In , L. David Baron (dbaron) wrote :

Reed, why do you think gcov is the same as PGO? They're very different things, although I could understand if they shared some common infrastructure. Is there something I'm missing?

Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

(In reply to comment #31)
> > export LDFLAGS="-lgcov -static-libgcc"
>
> I can try that, but sounds like
> https://developer.mozilla.org/en/Building_with_Profile-Guided_Optimization
> needs updating. Or the build target should perhaps handle this automatically.

The build system should handle this all automatically. It's not doing anything complicated, just -fprofile-generate / -fprofile-use:
http://mxr.mozilla.org/mozilla-central/source/configure.in#7030

Revision history for this message
In , Reed Loden (reed) wrote :

(In reply to comment #32)
> Reed, why do you think gcov is the same as PGO? They're very different things,
> although I could understand if they shared some common infrastructure. Is
> there something I'm missing?

I only mentioned gcov because of what the errors in comment #24 said.

Revision history for this message
In , Bzbarsky (bzbarsky) wrote :

Adding those LDFLAGS doesn't help; I still get the error from comment 24. The relevant command running at the time is:

c++ -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-long-long -pedantic -g -fno-strict-aliasing -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -g -fno-inline -Os -freorder-blocks -fno-reorder-functions -fPIC -shared -Wl,-z,defs -Wl,-h,libplaces.so -o libplaces.so nsAnnoProtocolHandler.o nsAnnotationService.o nsFaviconService.o nsNavHistory.o nsNavHistoryExpire.o nsNavHistoryQuery.o nsNavHistoryResult.o nsNavBookmarks.o nsMaybeWeakPtr.o nsMorkHistoryImporter.o nsPlacesModule.o nsNavHistoryAutoComplete.o -lpthread -lgcov -static-libgcc -Wl,-rpath-link,/home/bzbarsky/mozilla/debug/obj-firefox-pgo/dist/bin -Wl,-rpath-link,/usr/local/lib ../../../../db/morkreader/libmorkreader_s.a /home/bzbarsky/mozilla/debug/obj-firefox-pgo/dist/lib/libunicharutil_s.a -L/home/bzbarsky/mozilla/debug/obj-firefox-pgo/dist/bin -lxpcom -lxpcom_core -L/home/bzbarsky/mozilla/debug/obj-firefox-pgo/dist/bin -L/home/bzbarsky/mozilla/debug/obj-firefox-pgo/dist/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl -Wl,--version-script -Wl,/home/bzbarsky/mozilla/debug/mozilla/build/unix/gnu-ld-scripts/components-version-script -Wl,-Bsymbolic -lasound -ldl -lm

Changed in firefox-3.0:
status: New → Confirmed
Changed in xulrunner-1.9:
status: Incomplete → Confirmed
Revision history for this message
John Vivirito (gnomefreak) wrote :

This will not land in 3.0 since it is stable release and should only get security updates, however i think we should work on it for 3.1 and up.

Revision history for this message
John Vivirito (gnomefreak) wrote :

Can you please file a bug upstream to ask them as a wishlist bug to provide PGO builds since at this time they do not build with PGO enabled. Please post the link here so we can track it.
 thanks

Revision history for this message
Festor (festor-deactivatedaccount) wrote :

John, I don't understand what you want say.

If Arch Linux has a Firefox with PGO, what problem are there in Ubuntu?

Revision history for this message
John Vivirito (gnomefreak) wrote : Re: [Bug 213708] Re: Please compile Firefox with PGO optimizations

On 03/06/2009 11:39 AM, Surfaz Gemon Meme wrote:
> John, I don't understand what you want say.
>
> If Arch Linux has a Firefox with PGO, what problem are there in Ubuntu?
>
It would be best if upstream shipped with PGO however i'm sure we can
but IMHO it would be best that way. You can ask asac in
#ubuntu-mozillateam but i'm fairly sure he would rather it be done upstream.

--
Sincerely Yours,
    John Vivirito

https://launchpad.net/~gnomefreak
https://wiki.ubuntu.com/JohnVivirito
Linux User# 414246

"How can i get lost, if i have no where to go"
    -- Metallica from Unforgiven III

Revision history for this message
Festor (festor-deactivatedaccount) wrote :

2009/3/6 John Vivirito <email address hidden>

> It would be best if upstream shipped with PGO however i'm sure we can
> but IMHO it would be best that way. You can ask asac in
> #ubuntu-mozillateam but i'm fairly sure he would rather it be done
> upstream.
>

Asac told me that he will try build debs with PGO enabled.

I don't understand why this feature should be came enable from upstream
since is a packaging task.

The only problem that I found when I trying to enable PGO in ubuntu firefox
package is in debian/rules file, which don't uses the parameters of
mozconfig file. Then I don't know where I should put 'mk_add_options
PROFILE_GEN_SCRIPT'

Revision history for this message
Alexander Sack (asac) wrote :

the main issue is that we need a minimal test webbrowser or something to properly PGO optimize xulrunner during build.

Changed in firefox-3.0:
importance: Undecided → Medium
status: Confirmed → Triaged
Changed in xulrunner-1.9:
status: Confirmed → Triaged
Changed in firefox-3.0:
importance: Medium → Wishlist
Revision history for this message
Alexander Sack (asac) wrote :

meaning: PGO building firefox wont help much as most is in xul that needs to be optimized.

Changed in firefox-3.1:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Alexander Sack (asac) wrote :

doing this for ffox 3.0 packages is out of reach. targetting it for ffox 3.1/xul 1.9.1 combo instead.

Changed in xulrunner-1.9.1:
importance: Undecided → Wishlist
status: New → Triaged
Changed in xulrunner-1.9:
status: Triaged → Won't Fix
Changed in firefox-3.0:
status: Triaged → Won't Fix
Revision history for this message
Festor (festor-deactivatedaccount) wrote :

Please, then answer here too:

http://brainstorm.ubuntu.com/idea/18058/

Revision history for this message
Simon Strandman (nejsimon) wrote :

@john: Sorry for not replying earlier, I forgot to subscribe to this bug. The situation with firefox/xulrunner is making things a bit difficult. I'll see if I can figure something out.

Revision history for this message
Craig (candrews-integralblue) wrote :

I can't help but notice that, at the top, asac has marked that Jaunty won't be getting PGO for Xulrunner or Firefox 3.0 or 3.1/3.5. Is this true? Mozilla's Linux binaries are PGO enabled... isn't it good enough that upstream does it, as well as other distros?

If Jaunty really won't be getting PGO-enabled builds... if I may be so bold.. why not? Thanks

Revision history for this message
Reed Loden (reed) wrote :

On Mon, 23 Mar 2009 02:17:34 -0000
Craig <email address hidden> wrote:

> Mozilla's Linux binaries are PGO enabled... isn't it good enough
> that upstream does it, as well as other distros?

Uh, Mozilla's Linux binaries are not PGO enabled.
https://bugzilla.mozilla.org/show_bug.cgi?id=418866 is the upstream bug
tracking getting the Linux builds to use PGO.

Revision history for this message
Craig (candrews-integralblue) wrote :

Thank you Reed. I was had read (and should have linked to) another site that claimed upstream's binaries were PGO compiled now. I sincerely apologize for this mistake! :-/

Revision history for this message
John Vivirito (gnomefreak) wrote :

On 03/22/2009 10:17 PM, Craig wrote:
> I can't help but notice that, at the top, asac has marked that Jaunty
> won't be getting PGO for Xulrunner or Firefox 3.0 or 3.1/3.5. Is this
> true? Mozilla's Linux binaries are PGO enabled... isn't it good enough
> that upstream does it, as well as other distros?
>
> If Jaunty really won't be getting PGO-enabled builds... if I may be so
> bold.. why not? Thanks
>
This cant land in 3.0.x it will however be in 3.5 in Jaunty repos, when
well that is up to upstream but likely to be next major pre release.
It can only be applied to 3.5 and 3.6 since 3.0.x is final release and
only security fixes will land there.
we dont use Mozilla binaries we use their source to produce our own
binaries.

--
Sincerely Yours,
    John Vivirito

https://launchpad.net/~gnomefreak
https://wiki.ubuntu.com/JohnVivirito
Linux User# 414246

"How can i get lost, if i have no where to go"
    -- Metallica from Unforgiven III

Changed in xulrunner:
status: Unknown → Confirmed
Revision history for this message
John Vivirito (gnomefreak) wrote :

This is a xulrunner fix not firefox

Changed in firefox-3.1 (Ubuntu):
status: Triaged → Invalid
status: Invalid → Won't Fix
Revision history for this message
In , B-jacques (b-jacques) wrote :

Created an attachment (id=372234)
Use -fprofile-correction and enable PGO for jemalloc

I tried Mozilla's PGO build and at one point or another, GCC would bail out complaining about corrupted profiling files, much like the issue that led to patch #305385. It turns out that GCC's profiling support was written without taking threaded applications into account, leading to inconsistencies in profiling information, which would then cause GCC to error out when reading them later.

In GCC-4.4, a new compiler flag was added to solve this issue:

"When using -fprofile-generate with a multi-threaded program, the profile counts may be slightly wrong due to race conditions. The new -fprofile-correction option directs the compiler to apply heuristics to smooth out the inconsistencies. By default the compiler will give an error message when it finds an inconsistent profile."

This patch adds a the -fprofile-correction flag to the PGO compiler flags and re-enables PGO for jemalloc. Naturally, this adds a dependency on GCC-4.4 for PGO.

(I was unable to reproduce bz's linking issue.)

Revision history for this message
In , B-jacques (b-jacques) wrote :

(From update of attachment 372234)
Several rebuilds later I ran into the jemalloc build error. So clearly there is more going on here than meets the eye.

Revision history for this message
Michael Marley (mamarley) wrote :

Will it be possible to compile Firefox with PGO for Karmic?

Revision history for this message
Alexander Sack (asac) wrote : Re: [Bug 213708] Re: Please compile Firefox with PGO optimizations

On Thu, Apr 30, 2009 at 11:59:17PM -0000, Michael Marley wrote:
> Will it be possible to compile Firefox with PGO for Karmic?
>

Yes, we have this on on our list. Contributions welcome.

 - Alexander

Revision history for this message
Michael Marley (mamarley) wrote :

I have tried building a package with PGO, but I am not sure how that would interact with the separation between Firefox and XULRunner, so I am not quite sure where to start.

Revision history for this message
Alexander Sack (asac) wrote :

so the idea is to start xulrunner _instead_ of firefox as a minimal browser xulapp that connects to the PGO testcase proxy.

Revision history for this message
Samat Jain (tamasrepus) wrote :

AFAIK, for PGO in Firefox only the xulrunner package needs to be compiled. The "firefox-*" packages only contain XUL, Javascript, and other non-compiled resources.

Michael: what did you need to change in the debian/rules file to make PGO work? All build instructions I've found use client.mk; Ubuntu uses the Makefile in the top-level source directory which doesn't have a "profiledbuild" target. I don't understand the Firefox build process to understand how these files interact with each other and needs to be modified in the Ubuntu package to make this work.

Revision history for this message
In , Drdarkraven (drdarkraven) wrote :

TEST-UNEXPECTED-FAIL | (automation.py) | Exited with code -11 during test run
INFO | (automation.py) | Application ran for: 0:00:00.465828
make: *** [profiledbuild] Error 245

Changed in xulrunner (Debian):
status: Unknown → New
Revision history for this message
spitfire (mieszkoslusarczyk) wrote :

How about karmic, xulrunner-1.9.1/firefox3.5?

Changed in xulrunner-1.9 (Ubuntu):
status: Won't Fix → New
Revision history for this message
Alexander Sack (asac) wrote :

this i on our radar for karmic. yes.

Revision history for this message
In , Blasse (koralik) wrote :

I've got the same error on x86-64 with gcc4.4.0 no matter what mozconfig options I use.

Revision history for this message
In , Nephyrin (nephyrin) wrote :

I also get the TEST-UNEXPECTED-FAIL error when building with pgo in the moz-central branch as well as the 191 branch if pgo is on. The firefox profile-generation binary is segfaulting in __gcov_init -> strlen. I've tried the profile-correction patch as well as disabling jemalloc pgo with no success.
I get this on both 4.3 and 4.4, i haven't tested <=4.2

Revision history for this message
In , Scott Ritchie (scottritchie) wrote :

I ran into an identical gcov issue while trying to build Wine on Ubuntu 9.04: http://bugs.winehq.org/show_bug.cgi?id=18832

I'm beginning to think there's a deeper problem exposing this for both of us, like something within gcc and gcov

This thread (about another gcov problem): http://nic.uoregon.edu/pipermail/tau-users/2009-April/000245.html suggests that it might be a mismatch issue:

> I was able to reproduce this only by having a mismatch of GCC built
> libraries. When I used a GCC 3.4.6 built TAU/PDT, I got:
>
> % tau_cc.sh -fprofile-arcs -fprofile-generate foo.c
>
> ...
> : undefined reference to `__gcov_indirect_call_profiler'
>
> However, when I rebuilt TAU,PDT, and then used it, I had no problem.
>
> When I'd used all 3.4.6 built libraries, it all worked as well, only with
> the mismatch could I reproduce it.
>

Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

It certainly sounds like a busted GCC or gcov or something, not at all a problem with our codebase.

Revision history for this message
In , Blasse (koralik) wrote :

TEST-UNEXPECTED-FAIL | (automation.py) | Exited with code -11 during test run
INFO | (automation.py) | Application ran for: 0:00:00.465828
make: *** [profiledbuild] Error 245

Seems to connected with pgo script. When I'm using simple shell script, that just start and close ff, it builds just fine.

Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

The PGO script simply sets up the environment and launches the browser. The "code -11" there is the browser crashing.

Revision history for this message
In , Blasse (koralik) wrote :

Strange, as the same config give woring non-pgo build, also as I mentioned before, shell script produces working pgo build. So what's wrong? :)

Revision history for this message
In , Nephyrin (nephyrin) wrote :

There may be multiple issues at play, but when i was getting the code -11, running the profile-generate binary manually or through any script segfaulted. Non-pgo builds work fine for me, it's only the profile-generation binary that has issues. Skipping that and doing the final build without profile data negates the purpose of PGO.

Its possible your script is running the wrong binary, not stopping the build should it fail, or you're simply running into a different issue.

I've tried gcc 4.3 and 4.4, 4.4's profile-correction, enabling and disabling optimization, bare minimum mozconfigs, central and 191src. I used to run nightly builds with pgo on, and they just broke one day. I haven't gotten one to compile since.

Revision history for this message
In , Scott Ritchie (scottritchie) wrote :

Here's an issue I found from googling for gcov symbol errors:

http://stackoverflow.com/questions/566472/where-is-the-gcov-symbols

---
I just spent an incredible amount of time debugging a very similar error.
Here's what I learned:

    * You have to pass -fprofile-arcs -ftest-coverage when compiling.
    * You have to pass -fprofile-arcs when linking.
    * You can still get weird linker errors when linking. They'll look like
this: libname.a(objfile.o):(.ctors+0x0): undefined reference to `global
constructors keyed to long_name_of_file_and_function'

This means that gconv's having problem with one of your compiler-generated
constructors (in my case, a copy-constructor). Check the function mentioned in
the error message, see what kinds of objects it copy-constructs, and see if any
of those classes doesn't have a copy constructor. Add one, and the error will
go away.

Edit: Whether or not you optimize can also affect this. Try turing on /
switching off optimizations if you're having problems with it.
---

This may be what's causing the problem in both Wine and Firefox.

Revision history for this message
In , RobertSayre (sayrer) wrote :

fantastic

Revision history for this message
In , Bzbarsky (bzbarsky) wrote :

For my error, maybe the issue is the nsTArray use on MorkColumn (which has no copy ctor)? It'd suck if gcov required explicit copy ctors on everything we use nsTArray on. :(

Revision history for this message
In , Scott Ritchie (scottritchie) wrote :

Try fixing just one of the copy constructors and see if gcc errors in a different place - if so, then we'll indeed need one for every function :(

Revision history for this message
In , Brendan-mozilla (brendan-mozilla) wrote :

Why am I reading MorkAnything in 2009?

/be

Revision history for this message
In , Bzbarsky (bzbarsky) wrote :

Because you want to be able to migrate Firefox 2 user profiles?

Revision history for this message
In , Gavin Sharp (gavin-sharp) wrote :

MorkReader (not Mork itself) is still used for import from pre-Firefox 3.0 history.

Revision history for this message
In , Shaver (shaver) wrote :

(Personally, I don't mind if FF-after-3.5, or even FF 3.5.1 can't import history from FF 2.0.)

Revision history for this message
In , Mike Connor (mconnor) wrote :

We should get that on file... I'm not opposed to killing migration-from-distant-past in .next, though 3.5.1 seems premature.

Revision history for this message
Michael Marley (mamarley) wrote :

Now that Firefox 3.5 is out, it would probably be a good time to get started on this. I have been playing around with the source code, trying to get it to compile with PGO, but I can't find any way to make that work. It seems as if Ubuntu is using a completely different build system than the default.

Revision history for this message
Othmane Moustaouda (othmane) wrote :

@Micheal Marley
Me too I've tried to compile it with PGO under Ubuntu by following the tutorial from Mozilla site, but it seems doesn't work...

[Little OT]
Will there be Firefox 3.5 packages for Jaunty?
[/Little OT]

Revision history for this message
Michael Marley (mamarley) wrote :

(In response to little OT)

I don't know about officially, but I have some almost-final (post-RC2) builds of Firefox 3.5 for Jaunty in my PPA. https://edge.launchpad.net/~thefirstm/+archive/ppa

Revision history for this message
Michael Rooney (mrooney) wrote : Re: [Bug 213708] Re: Please compile Firefox with PGO optimizations

On Mon, Jul 6, 2009 at 10:26 AM, Othmane Moustaouda<email address hidden> wrote:
> Will there be Firefox 3.5  packages for Jaunty?

There has been for a while, "firefox-3.5". Currently it is a beta 4
build from late March (though is up to date in Karmic) but is planned
to be upgraded in the near future. Also if you want bleeding edge
there is a daily builds PPA provided by Mozilla.

Revision history for this message
John Vivirito (gnomefreak) wrote :

On 07/06/2009 01:57 PM, Michael Marley wrote:
> (In response to little OT)
>
> I don't know about officially, but I have some almost-final (post-RC2)
> builds of Firefox 3.5 for Jaunty in my PPA.
> https://edge.launchpad.net/~thefirstm/+archive/ppa
>
Jaunty should have final 3.5. The version in Jaunty is
3.5+nobinonly-0ubuntu0.9.04.1 (jaunty) that is final version

--
Sincerely Yours,
    John Vivirito

https://launchpad.net/~gnomefreak
https://wiki.ubuntu.com/JohnVivirito
Linux User# 414246

"How can i get lost, if i have no where to go"
    -- Metallica from Unforgiven III

Revision history for this message
In , tqft (ianburrows-au) wrote :

make -f client.mk profiledbuild not working at present
/media/sdb1/programs/mozilla/central/src/netwerk/protocol/http/src/nsHttpConnectionMgr.cpp:989: error: corrupted profile info: number of executions for edge 2-3 thought to be 30069
/media/sdb1/programs/mozilla/central/src/netwerk/protocol/http/src/nsHttpConnectionMgr.cpp:989: error: corrupted profile info: number of executions for edge 2-5 thought to be -1
nsHttpAuthManager.cpp
make[9]: *** [nsHttpConnectionMgr.o] Error 1

make -f client.mk build working

Last time I built successfully was about last Thursday or Friday (am at GMT+10) here

Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

This looks like a GCC problem. I think given the sheer number of comments here, GCC's PGO is so buggy/fickle as to be unusable.

Revision history for this message
In , tqft (ianburrows-au) wrote :

And today
make -f client.mk profiledbuild
is working
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2a1pre) Gecko/20090723 Minefield/3.6a1pre ID:20090723105705

It did complain and stop in the configure section about libiw-dev being missing (ubuntu here and apt-get fixed that) but I don't know if that is related to the previous failure.

Revision history for this message
In , tqft (ianburrows-au) wrote :

Profiledbuild died again today 1245pm Monday 3 Aug 2009 Aust Eastern Std Time (GMT +10). Don't know when the change to make it fail happened. Sometime between now and last Thursday.

/media/sdb1/programs/mozilla/central/src/xpcom/threads/nsEventQueue.cpp: In member function ‘PRBool nsEventQueue::PutEvent(nsIRunnable*)’:
/media/sdb1/programs/mozilla/central/src/xpcom/threads/nsEventQueue.cpp:141: error: corrupted profile info: number of executions for edge 17-18 thought to be 3064
/media/sdb1/programs/mozilla/central/src/xpcom/threads/nsEventQueue.cpp:141: error: corrupted profile info: number of executions for edge 17-23 thought to be -1
/media/sdb1/programs/mozilla/central/src/xpcom/threads/nsEventQueue.cpp:141: error: corrupted profile info: number of executions for edge 23-24 thought to be 3064
/media/sdb1/programs/mozilla/central/src/xpcom/threads/nsEventQueue.cpp:141: error: corrupted profile info: number of executions for edge 23-26 thought to be -1
make[7]: *** [nsEventQueue.o] Error 1
make[7]: *** Waiting for unfinished jobs....
/media/sdb1/programs/mozilla/central/src/xpcom/threads/nsThreadPool.cpp: In member function ‘virtual nsresult nsThreadPool::Run()’:
/media/sdb1/programs/mozilla/central/src/xpcom/threads/nsThreadPool.cpp:163: warning: ‘idleSince’ may be used uninitialised in this function
make[7]: Leaving directory `/media/sdb1/programs/mozilla/obj-i686-pc-linux-gnu/ffpgo/browser/xpcom/threads'
make[6]: *** [libs] Error 2
make[6]: Leaving directory `/media/sdb1/programs/mozilla/obj-i686-pc-linux-gnu/ffpgo/browser/xpcom'
make[5]: *** [libs_tier_xpcom] Error 2
make[5]: Leaving directory `/media/sdb1/programs/mozilla/obj-i686-pc-linux-gnu/ffpgo/browser'
make[4]: *** [tier_xpcom] Error 2
make[4]: Leaving directory `/media/sdb1/programs/mozilla/obj-i686-pc-linux-gnu/ffpgo/browser'
make[3]: *** [default] Error 2
make[3]: Leaving directory `/media/sdb1/programs/mozilla/obj-i686-pc-linux-gnu/ffpgo/browser'
make[2]: *** [build] Error 2
make[2]: Leaving directory `/media/sdb1/programs/mozilla/central/src'
make[1]: *** [build] Error 2
make[1]: Leaving directory `/media/sdb1/programs/mozilla/central/src'
make: *** [profiledbuild] Error 2

ordinary build works.

Is there any chance of having an official pgo build attempted once per day, so that there will exist a body of data about how and when it fails?

Revision history for this message
Michael Marley (mamarley) wrote :

What kind of progress is being made on getting this ready for Karmic? Will a FFE be necessary?

Revision history for this message
John Vivirito (gnomefreak) wrote : Re: [Bug 213708] Re: Please compile Firefox with PGO optimizations

On 09/16/2009 05:38 PM, Michael Marley wrote:
> What kind of progress is being made on getting this ready for Karmic?
> Will a FFE be necessary?
>
Upstream has not completed this yet IIRC. We are waiting for
them to finish and we will roll it out on the release they fix
this on. not sure what we will do with proir versions but im
ffairly sure we will not apply it to them.

--
Sincerely Yours,
    John Vivirito

https://launchpad.net/~gnomefreak
https://wiki.ubuntu.com/JohnVivirito
Linux User# 414246

"How can i get lost, if i have no where to go"
    -- Metallica from Unforgiven III

Revision history for this message
Michael Marley (mamarley) wrote :

Is there any progress here? Might this be easier to do now that Firefox and XULRunner are packaged together?

Revision history for this message
Mathias Burén (mathias-buren) wrote :

What's the status on this? Are there any reasons not to use pgo?

Revision history for this message
SoWeLie (sowelie) wrote :

Any progress on this? It is pretty embarrassing how slow Firefox on Ubuntu is compared to Windows.

Revision history for this message
Majki-Fajki (miles-teg) wrote :

On Arch Linux it's swings :))

Revision history for this message
In , Tglek (tglek) wrote :

(In reply to comment #57)
> This looks like a GCC problem. I think given the sheer number of comments here,
> GCC's PGO is so buggy/fickle as to be unusable.

That may be, but we have enough gcc-brains in mozilla now that we have little excuse to not try to deploy it. Here is why.

I am building with gcc 4.4.3 on fedora, didn't run into any issues mentioned in this bug(may be luck).

Here are some cold startup numbers. First is the name where ordered=(application of bug 549749), static=(bug 525013), and pgo=(pgo with debloating -freorder-blocks-and-partition). Second column is cold startup time. Third column is RSS(ie how much ram is paged in via mmap, in this experiment it basically demonstrates how horribly inefficiently our code is laid out right now).

firefox.stock: 2515ms 49452

firefox.ordered 1919ms 45344

firefox.static 2321ms 49616

firefox.static.ordered 1577ms 37072

firefox.static.pgo 1619ms 38436

The improvements in startup stem completely from improved seeking behavior. There is a 3x reduction in pagefaults between the slowest and fastest build.
The reason why pgo is fast(as far as I can tell it does not lay out the binary chronologically) is because -freorder-blocks-and-partition breaks up functions into their useful part(ie the part that executes) and a bloated part(ie error checking that isn't needed 99% of the time.
Unfortunately I haven't yet figured out how to chronologically order symbols in a pgo build, that would result in the fastest-feasible-firefox-binary.

Conclusion: PGO wins are massive and very real. Because of -freorder-blocks-and-partition pgo can effectively debloat our functions resulting in a nimbler-smaller firefox. This combined with likely more efficient-runtime performance means we should aggressively pursue PGO.

Aside: All this made me wonder if it's possible to build on top of -freorder-blocks-and-partition to output cold functions as thumb for mobile. From my limited understanding of arm stuff, that should give us a very nice footprint win.

Revision history for this message
In , Blizzard (blizzard) wrote :

I think Taras just signed up.

Revision history for this message
In , Mh+mozilla (mh+mozilla) wrote :

FWIW, all I got from trying to build with PGO is a crash during libxul initialization when the profile is being run, i.e. after the first build, not the second one. And the crash has a very nice mozilla unrelated backtrace:
 #0 0x00007ffff40807c1 in strlen () from /lib/libc.so.6
#1 0x00007ffff6823a92 in __gcov_init () from /tmp/xulrunner/dist/bin/libxul.so
#2 0x00007ffff6824f56 in __do_global_ctors_aux () from /tmp/xulrunner/dist/bin/libxul.so
#3 0x00007ffff51888ab in _init () from /tmp/xulrunner/dist/bin/libxul.so
#4 0x00007fffffffe908 in ?? ()
#5 0x00007ffff7dee429 in ?? () from /lib64/ld-linux-x86-64.so.2
#6 0x00007ffff7dee5af in ?? () from /lib64/ld-linux-x86-64.so.2
#7 0x00007ffff7de1b2a in ?? () from /lib64/ld-linux-x86-64.so.2
#8 0x0000000000000001 in ?? ()
#9 0x00007fffffffeb8c in ?? ()
#10 0x0000000000000000 in ?? ()

I haven't tried on x86, though, only on x86-64. But that means PGO already doesn't work everywhere.

I do think, however, that what could be more interesting than PGO (and would work better) is profile guided code improvement. The idea would be to hint the compiler that chunks of code are likely or unlikely to be run, depending on data gathered from the profile, using __builtin_expect() for gcc, for example. I think that would make at the very least 50% (if not near 100%) of what PGO does, without having to build twice, and without resorting on gcc working properly for PGO.

Revision history for this message
In , Mh+mozilla (mh+mozilla) wrote :

Confirmed, with the same gcc options, pgo works on x86 but not on x86-64.

Revision history for this message
In , Tglek (tglek) wrote :

(In reply to comment #63)
> Confirmed, with the same gcc options, pgo works on x86 but not on x86-64.

Which version of gcc? I can't seem to get anything other than 4.4 to build stuff.

Revision history for this message
In , Jfelps (jfelps) wrote :

I get basically the same crash after the first build on x86-64, with gcc 4.4.3.

Revision history for this message
In , Mh+mozilla (mh+mozilla) wrote :

> Which version of gcc? I can't seem to get anything other than 4.4 to build
> stuff.

4.4.3 from debian for both x86 and x86-64.

Revision history for this message
In , Tglek (tglek) wrote :

Figured out the problem. profiledbuild doesn't work on GCC 4.3 because the build system occasionally drops the -fprofile-generate flags(ie while building parts of nss) which then confuses things at link time(newer compilers seem to be more lenient there).
Unfortunately even if one does pass the pgo options everywhere, the second build fails because gcc 4.3 does not have -Wcoverage-mismatch. Figuring out what compiler we should switch to now (4.5 or 4.4).

Revision history for this message
Scott Ritchie (scottritchie) wrote :

Why doesn't Arch get the build failures mentioned in the upstream bug report?

Revision history for this message
In , Richard (shiningarcanine) wrote :

Taras, I am having difficulty reproducing your results. I am using a Slackware Linux user's build script to build firefox with PGO enabled:

http://www.linuxquestions.org/questions/linux-software-2/building-firefox-3-6-a-profile-guided-optimization-pgo-automated-build-script-784164/

I made some improvements to her script and contributed them back to the thread at linuxquestions.org, however, I am unable to reproduce any improvements in Sun Spider benchmarks when comparing her script's PGO-build to the system Firefox, even if both are patched to enable TraceMonkey support on 64-bit Linux.

I think my difficulty is because -freorder-blocks-and-partition is not being passed to GCC. What are you doing to pass -freorder-blocks-and-partition to GCC during the initial build?

Revision history for this message
In , Tglek (tglek) wrote :

(In reply to comment #68)
> I think my difficulty is because -freorder-blocks-and-partition is not being
> passed to GCC. What are you doing to pass -freorder-blocks-and-partition to GCC
> during the initial build?
in configure.in change
MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer $MOZ_OPTIMIZE_SIZE_TWEAK" to
MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks-and-partition -fomit-frame-pointer $MOZ_OPTIMIZE_SIZE_TWEAK"

Those pgo instructions are a bit crazy. See https://developer.mozilla.org/en/Building_with_Profile-Guided_Optimization , all you have to do is make a script that can launch firefox. Add the PROFILE_GEN_SCRIPT bit to your .mozconfig and do make -f client.mk profiledbuild

Revision history for this message
In , Richard (shiningarcanine) wrote :

Taras, thankyou for the information. I tried building firefox using mozilla's pgo instructions, but whenever I try building it, I get the following error message mid-way through the build:

OBJDIR=/home/richard/firefox-build/vanilla/mozilla-1.9.2/../firefox-build python /home/richard/firefox-build/vanilla/mozilla-1.9.2/../firefox-build/_profile/pgo/profileserver.py
INFO | automation.py | Application pid: 28455
TEST-UNEXPECTED-FAIL | automation.py | Exited with code -11 during test run
INFO | automation.py | Application ran for: 0:00:00.109925
make: *** [profiledbuild] Error 245

It has been like this whenever I would try doing PGO-builds over the past few years. Googling the error message gives me plenty of people with the same issue, but no solutions.

Revision history for this message
In , Tglek (tglek) wrote :

(In reply to comment #70)
> Taras, thankyou for the information. I tried building firefox using mozilla's
> pgo instructions, but whenever I try building it, I get the following error
> message mid-way through the build:
>
> OBJDIR=/home/richard/firefox-build/vanilla/mozilla-1.9.2/../firefox-build
> python
> /home/richard/firefox-build/vanilla/mozilla-1.9.2/../firefox-build/_profile/pgo/profileserver.py
> INFO | automation.py | Application pid: 28455
> TEST-UNEXPECTED-FAIL | automation.py | Exited with code -11 during test run
> INFO | automation.py | Application ran for: 0:00:00.109925
> make: *** [profiledbuild] Error 245

I am guessing that this this due to the same segfault as others have reported(on 64bit). This may be due to our buildsystem occasionally omitting pgo flags. The other approach to doing pgo is to build with
export PGO="-fprofile-generate=/tmp/pgo -fprofile-arc"
export CXX="g++ $PGO"
export CC="cc $PGO"
in your .mozconfig
then run firefox, then build it a second time with PGO=-fprofile-use=/tmp/pgo

It would be cool if someone could figure out how to build firefox with pgo on 64bit.

Revision history for this message
In , Mh+mozilla (mh+mozilla) wrote :

I don't see why the flags would be sometimes ommitted when building on x86-64 and not on x86. My guess is that the problem lies in gcc. Even building with CXX="g++ --coverage" and CC="gcc --coverage" results in the same crashes.

Revision history for this message
In , Tglek (tglek) wrote :

(In reply to comment #72)
> I don't see why the flags would be sometimes ommitted when building on x86-64
> and not on x86. My guess is that the problem lies in gcc. Even building with
> CXX="g++ --coverage" and CC="gcc --coverage" results in the same crashes.

They are occasionally omitted on all platforms. Thanks for the info,

Revision history for this message
In , Tglek (tglek) wrote :
Revision history for this message
In , Tglek (tglek) wrote :

Created an attachment (id=440627)
pgo-friendly compiler flags

this plus fix in bug 560897 = working pgo on x86_64(and likely gcc 4.5)

Revision history for this message
In , Mh+mozilla (mh+mozilla) wrote :

-fprofile-correction in optim flags doesn't sound right

Revision history for this message
In , Tglek (tglek) wrote :

(In reply to comment #76)
> -fprofile-correction in optim flags doesn't sound right

it's not something that would land, just enough to show that pgo works. Sticking those flags in right places is the right thing(tm).

Revision history for this message
In , Tglek (tglek) wrote :

Created an attachment (id=442123)
configury

Revision history for this message
In , Virus-found (virus-found) wrote :

(In reply to comment #78)
> Created an attachment (id=442123) [details]
> configury

The patch is absolutely amazing. Works even with my complicated .mozconfig. Thank you very much! We all have been waiting for it.

Revision history for this message
Kwinz (ldm) wrote :

New patch upsteam.
https://bugzilla.mozilla.org/show_bug.cgi?id=418866
Let's get PGO working now!

Revision history for this message
In , Mh+mozilla (mh+mozilla) wrote :

(From update of attachment 442123)
Pushed as http://hg.mozilla.org/mozilla-central/rev/7a6a20da79ae

Should this bug be closed or is actually enabling pgo build on build servers part of this bug ?

Revision history for this message
In , Tglek (tglek) wrote :

(In reply to comment #80)
> (From update of attachment 442123 [details])
> Pushed as http://hg.mozilla.org/mozilla-central/rev/7a6a20da79ae
>
> Should this bug be closed or is actually enabling pgo build on build servers
> part of this bug ?

Thanks. We'll turn it on via bug 559964.

Changed in xulrunner:
status: Confirmed → Fix Released
Revision history for this message
In , Evgeny Burmentyev (vir-found) wrote :

Hm, it fails to compile now. Regression range is http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=ae1773250d39&tochange=5b3604a3cfbe

gcc -o now.o -c -fomit-frame-pointer -Wall -pthread -march=core2 -O2 -pipe -fPIC -UDEBUG -DMOZILLA_CLIENT=1 -DNDEBUG=1 -DHAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1 -DHAVE_VISIBILITY_PRAGMA=1 -DXP_UNIX=1 -D_GNU_SOURCE=1 -DHAVE_FCNTL_FILE_LOCKING=1 -DLINUX=1 -Di386=1 -DHAVE_LCHOWN=1 -DHAVE_STRERROR=1 -D_REENTRANT=1 -DFORCE_PR_LOG -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM -fprofile-use -fprofile-correction -Wcoverage-mismatch -freoder-blocks-and-partition /home/virus_found/abs/firefox/src/mozilla-central-build/nsprpub/config/now.c
cc1: error: unrecognized command line option "-freoder-blocks-and-partition"
make[5]: *** [now.o] Error 1

Revision history for this message
In , Tglek (tglek) wrote :

(In reply to comment #82)

> cc1: error: unrecognized command line option "-freoder-blocks-and-partition"
> make[5]: *** [now.o] Error 1

Sounds like you configured with one compiler and are building with an older one.

Revision history for this message
In , Evgeny Burmentyev (vir-found) wrote :

(In reply to comment #83)
> (In reply to comment #82)
>
> > cc1: error: unrecognized command line option "-freoder-blocks-and-partition"
> > make[5]: *** [now.o] Error 1
>
> Sounds like you configured with one compiler and are building with an older
> one.

I'm sorry, I don't get it. What do you mean by "configured"? I configure with autoconf-2.13.

Revision history for this message
In , Mh+mozilla (mh+mozilla) wrote :

(In reply to comment #83)
> (In reply to comment #82)
>
> > cc1: error: unrecognized command line option "-freoder-blocks-and-partition"
> > make[5]: *** [now.o] Error 1
>
> Sounds like you configured with one compiler and are building with an older
> one.

It just looks like there is a typo... reoder vs. reorder.

Revision history for this message
In , Evgeny Burmentyev (vir-found) wrote :

(In reply to comment #85)
> It just looks like there is a typo... reoder vs. reorder.

Yes, this turns out to be the reason. This was introduced in http://hg.mozilla.org/mozilla-central/rev/b5b016bb7c91

Revision history for this message
In , Evgeny Burmentyev (vir-found) wrote :

Created attachment 449604
fixes two typos, introduced in b5b016bb7c91 commit

Revision history for this message
In , Evgeny Burmentyev (vir-found) wrote :

Comment on attachment 449604
fixes two typos, introduced in b5b016bb7c91 commit

I'm not permitted to change anything in this bug, but adding comments and patches, so this needs to be checked in.

Revision history for this message
In , Ted Mielczarek (ted-mielczarek) wrote :

Comment on attachment 449604
fixes two typos, introduced in b5b016bb7c91 commit

This is fallout from bug 564851. My patch there is correct, but somehow I screwed it up while landing, apparently. I checked in a fix in NSPR CVS.

Changed in xulrunner:
importance: Unknown → Medium
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

This is something we are going to try and get working in Natty

affects: xulrunner-1.9.1 (Ubuntu) → firefox (Ubuntu)
Changed in firefox (Ubuntu):
assignee: nobody → Chris Coulson (chrisccoulson)
Changed in xulrunner-1.9 (Ubuntu):
status: New → Won't Fix
Revision history for this message
Ted Mielczarek (ted-mielczarek) wrote :

We have finally flipped this on for our official Firefox Linux builds using GCC 4.5, see https://bugzilla.mozilla.org/show_bug.cgi?id=559964 . Doing PGO for XULRunner would be a little different, since you'd need a different profiling script.

Revision history for this message
sam tygier (samtygier) wrote :

official firefox 6 builds now have PGO. ubuntu 6.0+build1+nobinonly-0ubuntu0.11.04.1 does not have it.

Revision history for this message
sam tygier (samtygier) wrote :

I ran the peacekeeper benchmark on the official mozilla ff6 build, and ubuntu 6.0+build1+nobinonly-0ubuntu0.11.04.1. on an intel atom N270, with 2GB ram and an SSD.

official ff6 1002
rendering 761
soc networking 844
complex graphics 3687
data 1401
DOM 722
text 1557

ubuntu ff6 888
rendering 544
soc networking 678
complex graphics 3139
data 1436
DOM 618
text 1691

so a bit more than a 10% improvement for me on low end hardware.

Revision history for this message
madbiologist (me-again) wrote :

Is PGO enabled in firefox 7.0~b4+build2+nobinonly-0ubuntu1 in the Ubuntu 11.10 repositories?

Revision history for this message
madbiologist (me-again) wrote :

Is PGO enabled in firefox 7.0+build2+nobinonly-0ubuntu4 in the Ubuntu 11.10 repositories?

Revision history for this message
sam tygier (samtygier) wrote :

no, still built with -Os. you can check by putting about:buildconfig in the url bar.

madbiologist (me-again)
tags: added: lucid maverick natty oneiric
Revision history for this message
greg (grigorig) wrote :

Firefox' Linux release builds have been using PGO for some time now. The difference is quite noticeable, especially on slow systems, such as netbooks. Why is this not used by Ubuntu yet? Firefox is Ubuntu's standard browser and users should have the best experience possible.

What is missing to get this working? Is it still possible to get PGO builds into Precise? I'm willing to help.

Revision history for this message
madbiologist (me-again) wrote :

Note that we should also build with -O3 to get the best out of PGO - see https://bugzilla.mozilla.org/show_bug.cgi?id=590181

@Sam Tygier - re comment #135 - unless I am understanding what I've read in the Mozilla bugs incorrectly, -Os seems to be an alternative to -O1/O2/O3, and as such, is separate to PGO. Is this correct, and if so what should I look for in about:buildconfig to confirm the use of PGO? I couldn't find this in the Mozilla bugs.

Revision history for this message
greg (grigorig) wrote :

You need to check for -fprofile-use.

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Fixed in quantal

Changed in firefox (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
greg (grigorig) wrote :

Are we going to see PGO in updated Firefox releases for precise?

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

You're getting a bit ahead of yourself, it hasn't even built in quantal yet. Perhaps ask me again in 4 months when it's had some proper testing there first

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

I'm turning this back off again due to continual build failures that are only reproducible on the buildd's, and because the the PPA builders are pretty much incapable of building it to help investigate

Changed in firefox (Ubuntu):
status: Fix Released → Triaged
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Actually, scratch that. We get the same build failure in thunderbird without PGO.

Changed in firefox (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

I'm backing this out of quantal. The benchmarks show negligible benefit of turning on PGO in most tests, and there isn't really any perceivable difference at all - certainly not enough to justify a 100% increase in build time

Changed in firefox (Ubuntu Quantal):
status: Fix Released → Won't Fix
Changed in firefox (Ubuntu):
status: Fix Released → Triaged
assignee: Chris Coulson (chrisccoulson) → nobody
no longer affects: firefox-3.0 (Ubuntu)
no longer affects: firefox-3.0 (Ubuntu Quantal)
no longer affects: firefox-3.1 (Ubuntu)
no longer affects: firefox-3.1 (Ubuntu Quantal)
no longer affects: xulrunner-1.9 (Ubuntu)
no longer affects: xulrunner-1.9 (Ubuntu Quantal)
Changed in firefox (Ubuntu Quantal):
assignee: Chris Coulson (chrisccoulson) → nobody
Revision history for this message
madbiologist (me-again) wrote :

Chris - thanks for your efforts on this. I am a little surprised to hear that the benchmarks show negligible benefit of turning on PGO in most tests, given what I have read previously in this bug and in the Mozilla bug reports. However I am not an expert so I guess it is possible. I just have one question - did you also build with -O3 as per comment #137?

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Yes, the build system automatically sets that when you build with PGO

Revision history for this message
zamazan4ik (zamazan4ik) wrote :

Regarding PGO benefits for Firefox, there is a thread: https://groups.google.com/g/mozilla.dev.platform/c/wwO48xXFx0A/m/ztg4i0DYAAAJ that shows measurable improvements from PGO.

Anyway, since the issue is quite old. Is PGO still disabled for Firefox in Ubuntu repositories? Maybe things have changed during these years...

Revision history for this message
Sebastien Bacher (seb128) wrote :

Yes, things changed since the report, Ubuntu provides firefox as a snap now and PGO has been enabled on the amd64 build for a while now
https://github.com/canonical/firefox-snap/commit/7fc10a451

Changed in firefox (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.