Closed Bug 877597 Opened 11 years ago Closed 4 years ago

High CPU usage on google.com

Categories

(Core :: JavaScript Engine, defect)

47 Branch
x86_64
macOS
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: laurens, Unassigned)

Details

(Keywords: perf)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:21.0) Gecko/20100101 Firefox/21.0 (Beta/Release)
Build ID: 20130511120803

Steps to reproduce:

HW: Macbook air with 1.7GHz Core i5, OS X 10.7.5.

Open google.com and performed a search.
No plugins (SAFE mode under new user gives same results).
HW acceleration on/off no difference.

Only thing that lowers CPU usage to similar levels as Safari is to use no-script plugin and block google.com => problems with google.com js or FF interpreter thereof?



Actual results:

Constant ~8-15% CPU usage shown by Activity Monitor, just showing google.com search results in safe mode. 




Expected results:

<1% CPU Usage (on a 1.7GHz CPU showing a static google search results page)
Assignee: nobody → general
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
does it happen in version 23 beta?
Flags: needinfo?(laurens)
Keywords: perf
Yes also with 23aurora. I found an easy way to reproduce (all plugins/addons off, no flash).

the following address gives 10% CPU usage, measured after 10s:
https://www.google.com/search?q=mozilla&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&channel=fflb

copy and paste the above into the URL bar. 
Press enter
(Google search results load)
CPU usage stays at 10%
Now select the search box to get a cursor
Whilst cursor is flashing: 10% CPU usage (!)
Click somewhere else on page, so that there is no more cursor - cpu usage <2%

so:
some text boxes on webpages need to be selected and de-selected in order to prevent high idle cpu usage?
Flags: needinfo?(laurens)
Assignee: general → nobody
Do you still see ths problem?

I cannot reproduce this using current nightly build
Flags: needinfo?(laurens)
Whiteboard: [closeme 2016-01-10]
I tried to reproduce this bug and I can confirm the bug - no plugins, no addons. 

I used Nightly 46.0a1 (2016-01-11), Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:46.0) Gecko/20100101 Firefox/46.0

I have the following results: 

* non-e10s window ~50% cpu usage 
* e10s window - ~ 15% per main process and ~30% per web content process

Steps to reproduce: 

1. Open new window and go to site www.google.com
2. watch the activity monitor - almost ~40% cpu usage per main and web content processes

If I switch to another tab, cpu usage is gone. If I go back, the cpu usage goes again to ~40%
about:support output


Application Basics
------------------

Name: Firefox
Version: 46.0a1
Build ID: 20160111030207
Update Channel: nightly
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:46.0) Gecko/20100101 Firefox/46.0
Multiprocess Windows: 2/2 (default: true)
Safe Mode: false

Crash Reports for the Last 3 Days
---------------------------------

All Crash Reports

Extensions
----------

Name: Firefox Hello
Version: 0.1
Enabled: true
ID: loop@mozilla.org

Name: Pocket
Version: 46.0a1
Enabled: true
ID: firefox@getpocket.com

Name: ADB Helper
Version: 0.8.6
Enabled: false
ID: adbhelper@mozilla.org

Name: DownThemAll!
Version: 2.0.18.1-signed
Enabled: false
ID: {DDC359D1-844A-42a7-9AA1-88A850A938A8}

Name: Firebug
Version: 2.0.11
Enabled: false
ID: firebug@software.joehewitt.com

Name: Google Translator for Firefox
Version: 2.1.0.5.1
Enabled: false
ID: translator@zoli.bod

Name: uBlock Origin
Version: 1.0.0.1
Enabled: false
ID: uBlock0@raymondhill.net

Name: Valence
Version: 0.3.3
Enabled: false
ID: fxdevtools-adapters@mozilla.org

Graphics
--------

Asynchronous Pan/Zoom: wheel input enabled
Device ID: 0x0166
GPU Accelerated Windows: 2/2 OpenGL (OMTC)
Supports Hardware H264 Decoding: No;
Vendor ID: 0x8086
WebGL Renderer: Intel Inc. -- Intel HD Graphics 4000 OpenGL Engine
windowLayerManagerRemote: true
AzureCanvasBackend: skia
AzureContentBackend: quartz
AzureFallbackCanvasBackend: none
AzureSkiaAccelerated: 1

Important Modified Preferences
------------------------------

accessibility.blockautorefresh: true
accessibility.browsewithcaret: true
accessibility.typeaheadfind: true
accessibility.typeaheadfind.flashBar: 0
browser.cache.disk.capacity: 358400
browser.cache.disk.filesystem_reported: 1
browser.cache.disk.smart_size.first_run: false
browser.cache.frecency_experiment: 4
browser.download.importedFromSqlite: true
browser.download.useDownloadDir: false
browser.places.smartBookmarksVersion: 7
browser.sessionstore.upgradeBackup.latestBuildID: 20160111030207
browser.startup.homepage: about:newtab
browser.startup.homepage_override.buildID: 20160111030207
browser.startup.homepage_override.mstone: 46.0a1
browser.tabs.loadInBackground: false
browser.tabs.remote.autostart: true
browser.tabs.remote.autostart.2: false
browser.urlbar.trimURLs: false
browser.urlbar.userMadeSearchSuggestionsChoice: true
browser.zoom.full: false
dom.apps.reset-permissions: true
dom.mozApps.used: true
extensions.lastAppVersion: 46.0a1
gfx.blacklist.direct2d: 3
gfx.crash-guard.glcontext.appVersion: 44.0
gfx.crash-guard.glcontext.deviceID: 0x0166
gfx.crash-guard.status.glcontext: 2
media.gmp-gmpopenh264.abi: x86_64-gcc3-u-i386-x86_64
media.gmp-gmpopenh264.enabled: true
media.gmp-gmpopenh264.lastUpdate: 1450806961
media.gmp-gmpopenh264.version: 1.5.3
media.gmp-manager.buildID: 20160111030207
media.gmp-manager.lastCheck: 1452627627
media.mediasource.webm.enabled: true
network.cookie.cookieBehavior: 3
network.cookie.lifetimePolicy: 2
network.cookie.prefsMigrated: true
network.predictor.cleaned-up: true
places.database.lastMaintenance: 1452275574
places.history.expiration.transient_current_max_pages: 104858
plugin.disable_full_page_plugin_for_types: application/pdf
plugin.importedState: true
plugin.state.default browser: 1
plugin.state.flash: 0
plugin.state.java: 0
print.print_bgcolor: false
print.print_bgimages: false
print.print_colorspace:
print.print_command:
print.print_downloadfonts: false
print.print_duplex: 1515870810
print.print_evenpages: true
print.print_in_color: true
print.print_margin_bottom: 0.5
print.print_margin_left: 0.5
print.print_margin_right: 0.5
print.print_margin_top: 0.5
print.print_oddpages: true
print.print_orientation: 0
print.print_page_delay: 50
print.print_paper_data: 0
print.print_paper_height: 11.00
print.print_paper_name:
print.print_paper_size_type: 1
print.print_paper_size_unit: 0
print.print_paper_width: 8.50
print.print_plex_name:
print.print_resolution: 1515870810
print.print_resolution_name:
print.print_reversed: false
print.print_scaling: 1.00
print.print_shrink_to_fit: true
print.print_to_file: false
print.print_unwriteable_margin_bottom: 57
print.print_unwriteable_margin_left: 25
print.print_unwriteable_margin_right: 25
print.print_unwriteable_margin_top: 25
print.printer_Canon_MG5200_series__069A8E000000.print_bgcolor: false
print.printer_Canon_MG5200_series__069A8E000000.print_bgimages: false
print.printer_Canon_MG5200_series__069A8E000000.print_duplex: 1515870810
print.printer_Canon_MG5200_series__069A8E000000.print_edge_bottom: 0
print.printer_Canon_MG5200_series__069A8E000000.print_edge_left: 0
print.printer_Canon_MG5200_series__069A8E000000.print_edge_right: 0
print.printer_Canon_MG5200_series__069A8E000000.print_edge_top: 0
print.printer_Canon_MG5200_series__069A8E000000.print_evenpages: true
print.printer_Canon_MG5200_series__069A8E000000.print_footercenter:
print.printer_Canon_MG5200_series__069A8E000000.print_footerleft: &PT
print.printer_Canon_MG5200_series__069A8E000000.print_footerright: &D
print.printer_Canon_MG5200_series__069A8E000000.print_headercenter:
print.printer_Canon_MG5200_series__069A8E000000.print_headerleft: &T
print.printer_Canon_MG5200_series__069A8E000000.print_headerright: &U
print.printer_Canon_MG5200_series__069A8E000000.print_in_color: true
print.printer_Canon_MG5200_series__069A8E000000.print_margin_bottom: 0.5
print.printer_Canon_MG5200_series__069A8E000000.print_margin_left: 0.5
print.printer_Canon_MG5200_series__069A8E000000.print_margin_right: 0.5
print.printer_Canon_MG5200_series__069A8E000000.print_margin_top: 0.5
print.printer_Canon_MG5200_series__069A8E000000.print_oddpages: true
print.printer_Canon_MG5200_series__069A8E000000.print_orientation: 0
print.printer_Canon_MG5200_series__069A8E000000.print_page_delay: 50
print.printer_Canon_MG5200_series__069A8E000000.print_paper_data: 0
print.printer_Canon_MG5200_series__069A8E000000.print_paper_height: 11.00
print.printer_Canon_MG5200_series__069A8E000000.print_paper_name:
print.printer_Canon_MG5200_series__069A8E000000.print_paper_size_type: 1
print.printer_Canon_MG5200_series__069A8E000000.print_paper_size_unit: 0
print.printer_Canon_MG5200_series__069A8E000000.print_paper_width: 8.50
print.printer_Canon_MG5200_series__069A8E000000.print_resolution: 1515870810
print.printer_Canon_MG5200_series__069A8E000000.print_reversed: false
print.printer_Canon_MG5200_series__069A8E000000.print_scaling: 1.00
print.printer_Canon_MG5200_series__069A8E000000.print_shrink_to_fit: true
print.printer_Canon_MG5200_series__069A8E000000.print_to_file: false
print.printer_Canon_MG5200_series__069A8E000000.print_unwriteable_margin_bottom: 20
print.printer_Canon_MG5200_series__069A8E000000.print_unwriteable_margin_left: 13
print.printer_Canon_MG5200_series__069A8E000000.print_unwriteable_margin_right: 13
print.printer_Canon_MG5200_series__069A8E000000.print_unwriteable_margin_top: 12
privacy.clearOnShutdown.downloads: false
privacy.clearOnShutdown.history: false
privacy.clearOnShutdown.offlineApps: true
privacy.cpd.extensions-dta: true
privacy.cpd.offlineApps: true
privacy.cpd.siteSettings: true
privacy.donottrackheader.enabled: true
privacy.sanitize.didShutdownSanitize: true
privacy.sanitize.migrateClearSavedPwdsOnExit: true
privacy.sanitize.migrateFx3Prefs: true
privacy.sanitize.sanitizeOnShutdown: true
services.sync.declinedEngines:
services.sync.engine.adblockplus: true
storage.vacuum.last.index: 1
storage.vacuum.last.places.sqlite: 1450901263

Important Locked Preferences
----------------------------

JavaScript
----------

Incremental GC: true

Accessibility
-------------

Activated: false
Prevent Accessibility: 0

Library Versions
----------------

NSPR
Expected minimum version: 4.11
Version in use: 4.11

NSS
Expected minimum version: 3.21 Basic ECC
Version in use: 3.21 Basic ECC

NSSSMIME
Expected minimum version: 3.21 Basic ECC
Version in use: 3.21 Basic ECC

NSSSSL
Expected minimum version: 3.21 Basic ECC
Version in use: 3.21 Basic ECC

NSSUTIL
Expected minimum version: 3.21
Version in use: 3.21

Experimental Features
---------------------
Flags: needinfo?(laurens)
Whiteboard: [closeme 2016-01-10]
Same problem, high CPU usage on google results page.
OS X
Refresh
HW and smooth scrolling on/off: no difference
2014 Macbook Pro

When I disable Javascript on Google.com or when I minimise then CPU < 3%, else CPU >20% on the results page (static display)!

Same bug as: https://bugzilla.mozilla.org/show_bug.cgi?id=1218169?

NB this has been a problem for me across 3 computers and several years... new profiles each time.
Application Basics
------------------

Name: Firefox
Version: 47.0.1
Build ID: 20160623154057
Update Channel: release
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:47.0) Gecko/20100101 Firefox/47.0
OS: Darwin 14.5.0 x86-64
Multiprocess Windows: 0/1 (Disabled)
Safe Mode: false

Crash Reports for the Last 3 Days
---------------------------------

All Crash Reports

Extensions
----------

Name: Firefox Hello
Version: 1.3.2
Enabled: true
ID: loop@mozilla.org

Name: Multi-process staged rollout
Version: 1.0
Enabled: true
ID: e10srollout@mozilla.org

Name: Pocket
Version: 1.0.2
Enabled: true
ID: firefox@getpocket.com

Graphics
--------

Asynchronous Pan/Zoom: none
Device ID: 0x0a2e
GPU Accelerated Windows: 0/1 Basic (OMTC)
Supports Hardware H264 Decoding: Yes
Vendor ID: 0x8086
WebGL Renderer: Intel Inc. -- Intel Iris OpenGL Engine
windowLayerManagerRemote: true
AzureCanvasAccelerated: 1
AzureCanvasBackend: skia
AzureContentBackend: quartz
AzureFallbackCanvasBackend: none

Important Modified Preferences
------------------------------

browser.cache.disk.capacity: 358400
browser.cache.disk.filesystem_reported: 1
browser.cache.disk.smart_size.first_run: false
browser.cache.disk.smart_size.use_old_max: false
browser.cache.frecency_experiment: 3
browser.download.importedFromSqlite: true
browser.places.smartBookmarksVersion: 7
browser.sessionstore.upgradeBackup.latestBuildID: 20160623154057
browser.startup.homepage_override.buildID: 20160623154057
browser.startup.homepage_override.mstone: 47.0.1
dom.apps.reset-permissions: true
dom.mozApps.used: true
extensions.lastAppVersion: 47.0.1
gfx.blacklist.direct2d: 3
media.gmp-gmpopenh264.abi: x86_64-gcc3-u-i386-x86_64
media.gmp-gmpopenh264.lastUpdate: 1469019114
media.gmp-gmpopenh264.version: 1.5.3
media.gmp-manager.buildID: 20160623154057
media.gmp-manager.lastCheck: 1469019113
media.gmp-widevinecdm.abi: x86_64-gcc3-u-i386-x86_64
media.gmp-widevinecdm.lastUpdate: 1469019117
media.gmp-widevinecdm.version: 1.4.8.866
media.gmp.storage.version.observed: 1
network.cookie.prefsMigrated: true
network.predictor.cleaned-up: true
places.history.expiration.transient_current_max_pages: 104858
plugin.disable_full_page_plugin_for_types: application/pdf
plugin.importedState: true

Important Locked Preferences
----------------------------

JavaScript
----------

Incremental GC: true

Accessibility
-------------

Activated: false
Prevent Accessibility: 0

Library Versions
----------------

NSPR
Expected minimum version: 4.12
Version in use: 4.12

NSS
Expected minimum version: 3.23 Basic ECC
Version in use: 3.23 Basic ECC

NSSSMIME
Expected minimum version: 3.23 Basic ECC
Version in use: 3.23 Basic ECC

NSSSSL
Expected minimum version: 3.23 Basic ECC
Version in use: 3.23 Basic ECC

NSSUTIL
Expected minimum version: 3.23
Version in use: 3.23

Experimental Features
---------------------
Version: 21 Branch → 47 Branch
Hardware: x86 → x86_64
What happens if you disable google "instant search"?
 https://www.youtube.com/watch?v=-U-GjtYrHAQ
see also bug 938464
(In reply to Wayne Mery (:wsmwk, NI for questions) from comment #7)
> What happens if you disable google "instant search"?
>  https://www.youtube.com/watch?v=-U-GjtYrHAQ

Hello, no effect. It still uses 10% per parent and 16%-20% per child process.
I can reproduce the problem: Two MacBooks do have the problem one one doesn't have it. I tried it with a complete new OSX account and the problem still occurs.
When I open google.com I too have the higher CPU usage on my Mac mini. I used Inspect Element and found out when i set the following CSS to display: none the CPU usage is normal again.

._b9g g-loading-icon

I think that the animation of the invisible loading icon is the reason.
I can confirm the observation in the previous comment. I have an open tab with google.nl search results and its process is eating between 20% and 40% CPU.

Switching to another tab in the same window or running |document.querySelector("._b9g g-loading-icon").style.display="none"| from the console reduces that process to ~5%.

Opening inspector and mousing over the first <div> inside that particular <g-loading-icon> element shows a square being rotated about its center. That's a lot of unseen busy-work.

Is this something Firefox can optimize (or even avoid doing) on its end? Otherwise I'd say this needs to be kicked to Google, I doubt they want their search results to be labeled as battery drains, even if its in a competitor's browser.
Ah! What Jürgen and I saw is being addressed in bug 1218169.

Do you still encounter this issue when using a current version?

Flags: needinfo?(roger.wegmann)
Flags: needinfo?(mkem)
Flags: needinfo?(laurens)
Flags: needinfo?(hiasl360)

On my Mac Mini with Firefox Developer Edition 70.0b8 Google has no high CPU usage anymore.

Flags: needinfo?(hiasl360)

Hello,

on my actual iMac (late 2015) the problem is gone. Actual usage: Main process ~1% and content process also ~1%. I'm using Nightly 71.0a1 (2019-09-19) (64-bit).

Michal.

Flags: needinfo?(mkem)

=> WFM per comment 15, comment 16

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Flags: needinfo?(roger.wegmann)
Flags: needinfo?(laurens)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.