Gentoolto: Firefox

Created on 11 May 2019  路  17Comments  路  Source: InBetweenNames/gentooLTO

ltoworkarounds.conf disables O3 on firefox, but it seems to be building ok for me. Does anyone else still have the issue mentioned that it forgets sessions?

All 17 comments

I will test it out shortly! In the meantime, to reproduce that issue, just save your session before closing (using remember my tabs) and then re-open. You'll see it right away if the bug is present.

Current stable and beta handles well everything I'm throwing at it, currently running this:

Screenshot_20190511_005802

without any issues, it's very snappy.

Tip for anyone building FF from source, current rust [1.34.1] builds fine with march-native and O3 rustflags, with system-llvm use flag, and clang 8. Saves both time when compiling rust and speeds up ff compilation.

@barolo How Did You Get Firefox To Show Build Tools And *Flags ? like in the img

unless you mean there's anything specially different to normal, the about:buildconfig page (you can see all available pages with the aptly named, about:about ). although for me it doesn't display the rust version, i also don't think i've passed any rust flags like they have done, which may be why... although i'm very tempted to give that a try now

image

@InBetweenNames It restores my tabs fine. Attaching config (@javashin about:buildconfig)

I also hacked out append-cxxflags from the ebuild: it builds without any of them (the ebuild adds -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns [this one is actually disabled by default at least on x86_64] -fno-schedule-insns2), however I found that if lifetime-dse is set to 2 (default) then there are a lot of warnings in profiled build about profile not matching control flow. Setting it to 1 results in three warnings which were the same as with default CFLAGS.

Two new random flags I threw in there for C++ are -fdevirtualize-at-ltrans (tries to turn virtual method calls into direct calls at ltrans stage using LTO information about the actual types) and -fvisibility-inlines-hidden which turns on hidden visibility for inline methods.

I can't believe -fdevirtualize-at-ltrans slipped past me! I'll look into testing this one out system-wide.
EDIT: And -fvisibility-inlines-hidden too, which makes a lot of sense in C++ code. Although, I expect that one would need workarounds for whenever a package needs the address of an inline function.

Okay, just tested it out -- I also filtered out append-cxxflags and upon inspecting the ebuild and eclass, it turns out it doesn't even filter out the rest of your flags even with flag-o-matic enabled. Pretty cool.

So far it's working great. I'm going to file an issue upstream that those flags don't seem to be necessary anymore.

Upstream bug + patch is here: https://bugs.gentoo.org/685632

@InBetweenNames did you see my comment about lifetime-dse? Did you get warnings in your build.log? Search for "does not match" -- in the second compile after profiling I get tons of these if I don't include -flifetime-dse=1.

Okay, just tested it out -- I also filtered out append-cxxflags and upon inspecting the ebuild and eclass, it turns out it doesn't even filter out the rest of your flags even with flag-o-matic enabled. Pretty cool.

Re the rest of the flags, you mean if you set custom-cflags and custom-optimization you don't need the flag-o-matic override thing right?

Last time I forced -O3 on firefox with gcc, it was still "working" but was giving out additional errors in the console that don't happen without it, had me worried of what may be broken underneath (it's been a long time since I last did that though, so maybe it's fixed). With clang, I recall that didn't matter though (it doesn't do the same optimizations), and lately I always use clang for it since it's the upstream default and they barely test with gcc anymore (or at least not modern gcc). The LTO+PGO build is apparently faster with clang too, again likely because they don't give enough attention to gcc anymore.

Edit: On another note, my buildconfig is showing -O3 even though I didn't specify it for this build (overriding my -O2 also shown there), firefox is the one adding it there. It may, or may not, be turning it off for specific parts though. Which would differ from forcing it on everything with your own flags.

@ionenwks current FF turns -O3 with pgo and lto useflags enabled

Last time I forced -O3 on firefox with gcc, it was still "working" but was giving out additional errors in the console that don't happen without it, had me worried of what may be broken underneath (it's been a long time since I last did that though, so maybe it's fixed). With clang, I recall that didn't matter though (it doesn't do the same optimizations), and lately I always use clang for it since it's the upstream default and they barely test with gcc anymore (or at least not modern gcc). The LTO+PGO build is apparently faster with clang too, again likely because they don't give enough attention to gcc anymore.

Edit: On another note, my buildconfig is showing -O3 even though I didn't specify it for this build (overriding my -O2 also shown there), firefox is the one adding it there. It may, or may not, be turning it off for specific parts though. Which would differ from forcing it on everything with your own flags.

With gcc 9 and profiling enabled there seems to be very little difference between O2 and O3 in terms of the actual optimizations enabled.

Firefox also does override the -O settings for some parts of the build I've seen that though didn't notice it increasing them (eg it removes custom RUSTFLAGS in some places at least).

@nivedita76 yup, I've noticed that too, it ditches some before profiling too

My bad -- thanks for updating the bug with your finding. I'll submit an updated patch sometime tomorrow.

Upstream patch was accepted!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Althorion picture Althorion  路  10Comments

KlausMeier picture KlausMeier  路  13Comments

javashin picture javashin  路  4Comments

mid-kid picture mid-kid  路  5Comments

ElDavoo picture ElDavoo  路  5Comments