Open Bug 1830453 Opened 2 years ago Updated 1 month ago

Firefox needs to be compiled with O2/O3 flag (depends on compiler) for better performance. Additionally LTO needs to enabled always.

Categories

(Firefox Build System :: General, enhancement)

Desktop
All
enhancement

Tracking

(Not tracked)

REOPENED

People

(Reporter: a.rainman, Assigned: a.rainman)

References

Details

Attachments

(4 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/112.0

Component: Untriaged → Performance Engineering
Product: Firefox → Core

Robert Longson [:longsonr]

I copy this from about:buildconfig page from the browser, additional it's look like that Windows build don't use key -O for Rust too? It may be this is an error in something else? Additionally, code don't have any flags for msvc compiler, but it definitely still uses for build and have dependences in the xul.dll and other parts of browser. And I don't understand why is the upx packer is still used for distribution?? The upx only increase memory footprint for any process and not do anything else. Oo

Build platform
target
x86_64-pc-mingw32
Build tools
Compiler Version Compiler flags
/builds/worker/fetches/clang/bin/clang-cl -Qunused-arguments -Xclang -std=gnu99 -Xclang -ivfsoverlay -Xclang /builds/worker/fetches/vs/overlay.yaml 15.0.5 -fcrash-diagnostics-dir=/builds/worker/artifacts -D_HAS_EXCEPTIONS=0 -Gy -Zc:inline -Gw
/builds/worker/fetches/clang/bin/clang-cl -Qunused-arguments -Xclang -std=c++17 -Xclang -ivfsoverlay -Xclang /builds/worker/fetches/vs/overlay.yaml 15.0.5 -fcrash-diagnostics-dir=/builds/worker/artifacts -TP -Zc:sizedDealloc- -D_HAS_EXCEPTIONS=0 -Gy -Zc:inline -Gw -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING -GR- -Z7 -O2 -Oy
/builds/worker/fetches/rustc/bin/rustc 1.67.0
Configure options

MOZ_AUTOMATION=1 --target=x86_64-pc-windows-msvc MOZILLA_OFFICIAL=1 --enable-update-channel=release MOZBUILD_STATE_PATH=/builds/worker/.mozbuild MOZ_FETCHES_DIR=/builds/worker/fetches WINSYSROOT=/builds/worker/fetches/vs CC=clang-cl CXX=clang-cl LINKER=lld-link ENABLE_CLANG_PLUGIN=1 --enable-profile-use=cross --with-pgo-profile-path=/builds/worker/fetches/merged.profdata --with-pgo-jarlog=/builds/worker/fetches/en-US.log MOZ_LTO=cross --enable-js-shell --enable-rust-simd --with-mozilla-api-keyfile=/builds/mozilla-desktop-geoloc-api.key --with-google-location-service-api-keyfile=/builds/gls-gapi.data --with-google-safebrowsing-api-keyfile=/builds/sb-gapi.data UPX=/builds/worker/fetches/upx-3.95-win64/upx.exe --enable-official-branding

Attached file Build config Windows β€”

Marking as new so that development team can have a look at this enhancement. Thank you.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Firefox needs to be compiled with O3 flag for better performance → Firefox needs to be compiled with Ox flag on Windows for better performance

[Tracking Requested - why for this release]:

Performance Impact: --- → ?
Summary: Firefox needs to be compiled with Ox flag on Windows for better performance → Firefox needs to be compiled with Ox flag on Windows and O3 flag on Linux for better performance.
Version: Firefox 112 → unspecified
OS: Unspecified → All
Hardware: Unspecified → Desktop
Summary: Firefox needs to be compiled with Ox flag on Windows and O3 flag on Linux for better performance. → Firefox needs to be compiled with Ox flag on Windows and O3 flag on Linux for better performance. MacOS builds is already O3.
Summary: Firefox needs to be compiled with Ox flag on Windows and O3 flag on Linux for better performance. MacOS builds is already O3. → Firefox needs to be compiled with Ox flag on Windows and O3 flag on Linux for better performance. MacOS builds is already O3. Additionally LTO needs to enbled everywhere.
Summary: Firefox needs to be compiled with Ox flag on Windows and O3 flag on Linux for better performance. MacOS builds is already O3. Additionally LTO needs to enbled everywhere. → Firefox needs to be compiled with Ox flag on Windows and O3 flag on other platforms for better performance. MacOS builds is already O3. Additionally LTO needs to enbled always.

Well... I currently self tested the build for Windows only with clang-cl, and it has significant improvements in the binary sizes, performance of the browser (up to 2.5x in some of my use cases).

Summary: Firefox needs to be compiled with Ox flag on Windows and O3 flag on other platforms for better performance. MacOS builds is already O3. Additionally LTO needs to enbled always. → Firefox needs to be compiled with Ox flag on Windows and O3 flag on other platforms for better performance. MacOS builds is already O3. Additionally LTO needs to enabled always.
Assignee: nobody → a.rainman
Status: NEW → ASSIGNED
Duplicate of this bug: 1417048
Component: Performance Engineering → General
Product: Core → Firefox Build System
Summary: Firefox needs to be compiled with Ox flag on Windows and O3 flag on other platforms for better performance. MacOS builds is already O3. Additionally LTO needs to enabled always. → Firefox needs to be compiled with O2/O3 flag (depends on compiler) for better performance. Additionally LTO needs to enabled always.

Apologies for the ping but is this one valid? I ask because I see the team is leaving no stone unturned to improve Speedometer score https://bugzilla.mozilla.org/show_bug.cgi?id=1800713

(In reply to Will from comment #12)

Apologies for the ping but is this one valid? I ask because I see the team is leaving no stone unturned to improve Speedometer score https://bugzilla.mozilla.org/show_bug.cgi?id=1800713

Yes, it is.

(In reply to Elle Solomina (she/her) from comment #13)

(In reply to Will from comment #12)

Apologies for the ping but is this one valid? I ask because I see the team is leaving no stone unturned to improve Speedometer score https://bugzilla.mozilla.org/show_bug.cgi?id=1800713

Yes, it is.

That's fantastic. Sorry to be a bother but could you run the Speedometer 3 test a few times and tell us how much of an improvement you see?

If this is just for Windows, there should be no concerns about RAM or disk space at this point. In late 2024 (or early 2025 by the time this would ship to production) the vast majority of Windows devices have more than enough RAM and disk space to justify using -O2/-O3. 15% of Firefox users have 4GB of RAM and that number is declining steadily https://data.firefox.com/dashboard/hardware#:~:text=The%20most%20popular%20memory%20sizes%20are%208GB%20and%2016GB%2C%20with%20almost%20one%2Dthird%20and%20one%2Dfifth%20of%20our%20Release%20users%2C%20respectively.

If this is also about the Android version of Firefox that's a bit more tricky because there's so many RAM and storage constrained devices out there that Google ships 2 different versions of Chrome. Is Firefox able to do that on Android? https://blog.chromium.org/2024/12/doubling-speedometer-scores-android.html#:~:text=The%20Android%20device,generate%20the%20orderfile.

(In reply to Will from comment #14)

(In reply to Elle Solomina (she/her) from comment #13)

(In reply to Will from comment #12)

Apologies for the ping but is this one valid? I ask because I see the team is leaving no stone unturned to improve Speedometer score https://bugzilla.mozilla.org/show_bug.cgi?id=1800713

Yes, it is.

That's fantastic. Sorry to be a bother but could you run the Speedometer 3 test a few times and tell us how much of an improvement you see?

Now I'm here again! :) But currently I can't bootstrap the source to test https://bugzilla.mozilla.org/show_bug.cgi?id=1967567

Yeap, it's work!

Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → WORKSFORME
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---

Be sure to use Speedometer 3.1 , which is the newest version

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: