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

Issue 758367 link

Starred by 5 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Headless Chrome Canary runs into terrible performance issues when navigating to a certain page

Reported by brian.k...@powwowmobile.com, Aug 23 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36

Steps to reproduce the problem:
1. Launch Headless Chrome Canary                 
                '--headless',
                '--disable-gpu',
                '-—disable-web-security',
                '--ignore-certificate-errors',
                '--allow-insecure-localhost',
                '--disable-popup-blocking',
                '--incognito',
                '--utility',
                '--window-size=1024x768
2. Navigate to page using remote debugger
3. See CPU spike

What is the expected behavior?

What went wrong?
There seems to be a rendering problem, specifically with layouts on this page.  When I performance profiled this page, the bottom-up told me that the Layout Activity was bottle-necking chrome.  When I expanded the Layout Activity tree, it told me that Parse HTML was taking the bulk of that time.

This page seems to be making a bunch of xhr requests for text/html documents, but is returning javascript and other types of resources.  The console shows me a bunch of these warnings:

'Resource interpreted as Document but transferred with MIME type application/javascript:  '

My theory is that since headless chrome is interpreting these resources as documents, it runs some sort of HTML parser, but since these resources are actually javascript, css, etc, the parser is not having a good time and causing performance issues.

This is not reproducible in chrome canary in non-headless mode.

These are the flags I use to launch chrome:

                '--headless',
                '--disable-gpu',
                '-—disable-web-security',
                '--ignore-certificate-errors',
                '--allow-insecure-localhost',
                '--disable-popup-blocking',
                '--incognito',
                '--utility',
                '--window-size=1024x768

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 62.0.3193.0  Channel: canary
OS Version: OS X 10.12.6
Flash Version: 

Attached is the screenshot of the profiling.  Seems like I can't save the recording using remote debugger.

The problem is happening on a sharepoint app.  If you need credentials and steps to reproduce for this app, please send me an email at brian.kwon@powwowmobile.com
 
Screen Shot 2017-08-23 at 1.22.10 PM.png
1.6 MB View Download
Components: Internals>Headless
Thanks for the report. 

That's certainly interest, I wonder why headless will interpret this differently. 

It would help greatly if you could find a small example of this happening that you could share here.

As a work around you might look into using Request Interception: https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-requestIntercepted
to block/modify these requests

Comment 3 by tapted@chromium.org, Aug 28 2017

Labels: -OS-Mac
[mac triage] maybe we need OS=Headless...

Comment 4 by hdodda@chromium.org, Aug 28 2017

Cc: hdodda@chromium.org
Labels: Needs-Triage-M62 Needs-Feedback
@brian.kwon-- Could you please check and try the wrok around steps provided in comment #2 and update the thread .

Thanks!
@dvallet @hdodda So I just tried using this work around.  It seems I need to use Network.continueInterceptedRequest in conjunction with this.  I'm able to alter the header values, but I'm unable to alter the resourceType which I think is the main issue.

As for the small example, I can provide you with the credentials to the site that I'm using, but I prefer not to post it on this board.  Can I e-mail you?
Project Member

Comment 6 by sheriffbot@chromium.org, Aug 28 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "hdodda@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
A minimal example that can be made public would be more convenient. But if its not possible (and you are ok with me sharing the information with the team), feel free to email me steps to reproduce
Sorry for the inconvenience, but I'm unable to find a public, minimal example for this issue as I'm not even sure what is causing it.  I've emailed you with steps to reproduce that's quite simple :)
Labels: OS-Mac
Status: Available (was: Unconfirmed)
Thanks for the info. 

I can confirm that this is happening in Headless mode on Mac. 

Linux and Windows do not show this performance regressions. 
The network stack should be the same on all platforms, so I'm not really sure why the difference. 


For reference, the warning that is produced on Mac is : 

Resource interpreted as Document but transferred with MIME type application/javascript: "https://s1-powerpoint-15.cdn.office.net/p/s/1685247226_App_Scripts/jSanity.js".

Could you paste the request headers when intercepted, I'm wondering if it could be an issue similar to this one: https://stackoverflow.com/questions/6587393/resource-interpreted-as-document-but-transferred-with-mime-type-application-zip
"{
  "interceptionId": "id-23",
  "request": {
    "url": "https://s1-excel-15.cdn.office.net/x/s/1685221877__layouts/Resources/1033/EwrDefault.css",
    "method": "GET",
    "headers": {
      "Upgrade-Insecure-Requests": "1",
      "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/62.0.3198.0 Safari/537.36",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"
    },
    "initialPriority": "VeryHigh",
    "referrerPolicy": "no-referrer-when-downgrade"
  },
  "resourceType": "Document",
  "isNavigationRequest": true
}"

These are the params from Network.requestIntercepted for the first instance of the issue.  Seems to be a similar issue as isNavigationRequest is marked as true.
Hi, wondering if there are any updates on this.
Project Member

Comment 13 by sheriffbot@chromium.org, Sep 6

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment