Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launch Chrome with --disable-renderer-backgrounding flag #123

Closed
cexbrayat opened this issue May 5, 2017 · 0 comments
Closed

Launch Chrome with --disable-renderer-backgrounding flag #123

cexbrayat opened this issue May 5, 2017 · 0 comments

Comments

@cexbrayat
Copy link
Contributor

cexbrayat commented May 5, 2017

On macOS 10.12.4 and Chrome 58.0.3029, it appears that my test suite is slow down if Chrome is in the background. #64 should have fixed it a long ago, but a comment is mentioning the --disable-renderer-backgrounding flag, so I gave it a try, and it does fix my issue:

Before (Angular CLI project using Karma/Chrome):

05 05 2017 10:44:24.333:INFO [launcher]: Starting browser Chrome
05 05 2017 10:44:25.105:INFO [Chrome 58.0.3029 (Mac OS X 10.12.4)]: Connected on socket xKymjhyLh5832m9sAAAA with id 81470424
Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 102 of 102 SUCCESS (5.512 secs / 5.473 secs)
Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 102 of 102 SUCCESS (29.198 secs / 29.164 secs)
Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 102 of 102 SUCCESS (27.1 secs / 26.266 secs)
Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 102 of 102 SUCCESS (28.606 secs / 27.676 secs)

First run is fast, the following are really slow.

After, with this karma.conf.js using the --disable-renderer-backgrounding flag:

    customLaunchers: {
      chromeBackground: {
        base: 'Chrome',
        flags: ['--disable-renderer-backgrounding']
      }
    },
    browsers: ['chromeBackground'],

The tests run faster:

05 05 2017 10:42:54.681:INFO [Chrome 58.0.3029 (Mac OS X 10.12.4)]: Connected on socket cAPHozikOSfUEEnpAAAA with id 83636627
Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 102 of 102 SUCCESS (5.666 secs / 5.628 secs)
Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 102 of 102 SUCCESS (6.864 secs / 6.831 secs)
Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 102 of 102 SUCCESS (7.129 secs / 7.109 secs)

This may be related to the Chrome issue https://bugs.chromium.org/p/chromium/issues/detail?id=605498#c1

cexbrayat added a commit to cexbrayat/karma-chrome-launcher that referenced this issue May 5, 2017
cexbrayat added a commit to cexbrayat/karma-chrome-launcher that referenced this issue May 5, 2017
vbanos pushed a commit to vbanos/brozzler that referenced this issue Feb 13, 2018
``--disable-background-timer-throttling`` and ``--disable-renderer-backgrounding``:
karma JS test runner uses these to improve chrome performance
karma-runner/karma-chrome-launcher#123

``--disable-hang-monitor``: Suppresses hang monitor dialogs in renderer
processes. This may allow slow unload handlers on a page to prevent the
tab from closing, but the Task Manager can be used to terminate the
offending process in this case.

``--mute-audio``: obvious.

The following are part of google safe browsing features:
``--disable-client-side-phishing-detection``
``--safebrowsing-disable-auto-update``
``--safebrowsing-disable-download-protection``

Reference: https://peter.sh/experiments/chromium-command-line-switches/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant