New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 668810 link

Starred by 4 users

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Message board burns an insane amount of energy

Project Member Reported by komoroske@chromium.org, Nov 26 2016

Issue description

Version: 55.0.2883.59 (Official Build) beta (64-bit)
OS: 10.11.6

What steps will reproduce the problem?
(1) Load a page on the Straight Dope Message Board. e.g. http://boards.straightdope.com/sdmb/showthread.php?t=811583

What is the expected result?
While the page is loading some CPU is used, but then it settles to basically nothing within 10 seconds.

What happens instead?
As measured by Activity Monitor, it uses ~75% CPU basically forever. It also always shows the loading indicator on the tab where the favicon goes--implying that some ad or something is never finishing its load.

The SDMB (Straight Dope Message Board) has long had really egregiously behaving ads, but it has recently gotten much worse. However, I've noticed this basic problem for the past 6 months or more.

Note that if you open the same tab in Safari, it also uses a ton of CPU, but about 1/5 as much. Some of it is in the Safari Networking process, some of it is in the Safari rendering process for that tab.

This is on a Mac Book Pro, 2015 era.

I would include a trace but tracing is broken on this machine (will file another bug soon).

 
Trace attached.

Assuming that the work Chrome ends up doing is reasonable, it all comes down to third party scripts:

Top 3:
 1. Google's Active View (osd.js): 2 flavors (http and https), on a ~300ms repeating timer
 2. choices.truste.com/ca?aid=... on a ~30/40ms repeating timer
 3. taboola.com's librtc js on a ~1s repeating timer

A quick read of the code involved suggest that IntersectionObserver would help:
 - Active View is expanding its support for IntersectionObserver.
 - Truste has been made aware of this new API but I'm not sure of their commitment.
 - We haven't reach out to Taboola yet (just Outbrain).

trace_trace.json.gz
4.8 MB Download
Oh, one more aspect (depends on the run): ads that keep on calling rAF despite reaching their last frame and not having any interactivity upon interaction.

Framework used by the ad on this run: Adobe Edge (js).
Kenji, when do you collected this trace, did you notice that the network spinner kept going? 

The things you've noted in the trace sound correct, but I'm surprised to not see any network activity implicated.

I'm wondering if perhaps you're getting different ads in Japan?
I've played around with this example on a few more machines:

* A Chromebook Pixel 2
* A Mac Pro
* The original MacBook Pro

I've noticed that the problem is strongest on the MacBook Pro. I've also noticed that the extremely high CPU usage only happens when the tab loading spinner is still going--once it stops, the CPU usage drops considerably. (Its baseline state is still ~7% CPU, which is still crazy, but not egregious). The tab loading spinner stays going far longer on the MBP for whatever reason--although every so often I'm able to observe it on my Pixel. When it's going, the MBP uses ~95% CPU, but the Pixel only uses ~50% CPU. The same very high CPU (~95%+) usage happens while the loading spinner is going on the Mac Pro, but it never spins for more than a few seconds, even though it's on the same network as the MBP and Pixel.

So it seems there's multiple problems going on: the more run-of-the-mill expensive-ads problem, but also a specific problem tied to network usage of the site. That problem *appears* to exist on multiple platforms but be excessively expensive on Mac. And it is *possible* that the condition that causes the spinner to keep going for longer is due to the display density of the device. (Both the MBP and the Pixel have high-density displays). 
Cc: erikc...@chromium.org ccameron@chromium.org
I can probably look into this at some nebulous time in the future, but as a first pass:

How are you ensuring that the same ads are loading when you run this page in Chrome/Safari, or on different platforms [or even across runs?]. My experience is that different browsers will frequently elicit different ads.
Cc: ojan@chromium.org
I'm not ensuring the ads are the same, unfortunately, which massively complicates the analysis. I'm not sure how best to do that... which seems like a recurring theme any time we try to debug very bad ad performance.
Cc: jkarlin@chromium.org csharrison@chromium.org bmcquade@chromium.org
cc'ing some other folks who might be interested
It would be great to get a trace of this (with all trace categories on if possible), I can see about reproing on mac when I get home.
I've tried taking a trace but have failed, as captured in  crbug.com/645154 .
Thanks for logging that issue, I've experienced it recently too. Probably we will need a trace with just a few core categories enabled.
Note that I'm seeing almost precisely the same behavior (but on every device I test on, including Mac Pro) with this page: https://www.fastcodesign.com/3065916/google-can-now-tell-you-how-busy-restaurants-are-in-real-time

On ChromeOS it pegged the CPU for ~15 minutes at 110% before I noticed it. On the Mac Pro it uses 110% CPU while loading and then settles back to ~7%.
Here's a trace on my Mac Pro of the behavior described in #12 in Canary with only that one tab open (plus the tracing tab).

I refreshed the page, and then waited until the CPU use declined. It took a longer time to settle from ~30% down ultimately to 12% or so 15 seconds or so into it.
trace_fastcodesigncpu.json.gz
8.0 MB Download
Labels: Needs-Investigation
Status: Available (was: Untriaged)
It's unclear what available actions we have at this point. This might be an interesting case study for someone new to speed, a fixit, or if someone lacks interesting projects.
Components: Speed

Comment 16 by ojan@chromium.org, Jan 10 2018

Owner: ellenpli@chromium.org

Comment 17 by ojan@chromium.org, May 8 2018

Cc: -ojan@chromium.org
Status: Assigned (was: Available)

Sign in to add a comment