High Power Consumption with Firefox

For some weeks I’ve noticed higher than usualy battery drain during the day. I later noticed this was happening when using Firefox.

using “about:processes” on some websites

Reddit front page

my cpu usage is quite high and looking at the output from the “amdgpu_top” command I see alot of GPU work. Measuring ( using Firefox “about:processes” ) the tab(s), I see that more than 50% of the time it’s the “RefreshDriver tick” and when I expand that, there’s alot of paint and layout going on even though visually everything on my screen ( Firefox area ) is idle/nothing changing.

I’ve checked ( about:support ) to see if all the hardware accelerated flags are enabled and they are ( WebRender and not WebRender software for example )

I’m seeing the same results using Arch Linux ( Linux 6.10.6 ) and Gentoo ( Linux 6.10.7 ), both using KDE Plasma 6.1.4 Wayland with 7840HS and 780M

I’m beginning to think this is bug(s) in Firefox

Looking at Firefox 129.0.2 source code (534mb~) ( I didn’t find a git repo of Firefox source code ) and did some grepping and found in source file “widget/gtk/GfxInfo.cpp” between lines 984-990 inclusive

    ////////////////////////////////////
    // FEATURE_WEBRENDER_COMPOSITOR
    APPEND_TO_DRIVER_BLOCKLIST(
        OperatingSystem::Linux, DeviceFamily::All,
        nsIGfxInfo::FEATURE_WEBRENDER_COMPOSITOR,
        nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED,
        V(0, 0, 0, 0), "FEATURE_FAILURE_WEBRENDER_COMPOSITOR_DISABLED", "");

which basically means Firefox with GTK will not use WEBRENDER_COMPOSITOR feature on Linux

and looking at source file “widget/GfxDriverInfo.h” between lines 17-35 inclusive

#define APPEND_TO_DRIVER_BLOCKLIST_EXT(                                       \
    os, screen, battery, windowProtocol, driverVendor, devices, feature,      \
    featureStatus, driverComparator, driverVersion, ruleId, suggestedVersion) \
  sDriverInfo->AppendElement(GfxDriverInfo(                                   \
      os, screen, battery,                                                    \
      (nsAString&)GfxDriverInfo::GetWindowProtocol(windowProtocol),           \
      (nsAString&)GfxDriverInfo::GetDeviceVendor(devices),                    \
      (nsAString&)GfxDriverInfo::GetDriverVendor(driverVendor),               \
      (GfxDeviceFamily*)GfxDriverInfo::GetDeviceFamily(devices), feature,     \
      featureStatus, driverComparator, driverVersion, ruleId,                 \
      suggestedVersion))

#define APPEND_TO_DRIVER_BLOCKLIST(os, devices, feature, featureStatus,     \
                                   driverComparator, driverVersion, ruleId, \
                                   suggestedVersion)                        \
  APPEND_TO_DRIVER_BLOCKLIST_EXT(                                           \
      os, ScreenSizeStatus::All, BatteryStatus::All, WindowProtocol::All,   \
      DriverVendor::All, devices, feature, featureStatus, driverComparator, \
      driverVersion, ruleId, suggestedVersion)

Doesn’t matter what combination, if your on Linux with what Firefox consider GTK, Firefox ain’t using it… fun

OFFTOPIC: I’ve also noticed high cpu usage with Firefox when it’s waiting for data to arrive or eventually website times out ( no rendering is being done )

3 Likes