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

Chrome tests large numbers of block requests are slower than test with the requests in #584

Closed
andydavies opened this Issue Mar 22, 2016 · 8 comments

Comments

Projects
None yet
3 participants
@andydavies
Copy link
Contributor

andydavies commented Mar 22, 2016

I often block third-parties to understand what impact they're having on a page, but I've noticed page loads get longer in Chrome when there's a large number of block requests.

telegraph.co.uk in Firefox
http://www.webpagetest.org/result/160205_JB_fc1c78112a10e001d874500285adb534/

telegraph.co.uk in Firefox with 3rd Parties blocked
http://www.webpagetest.org/result/160205_TE_0352ac18021c35bad63d55526671dca7/

telegraph.co.uk in Chrome with 3rd Parties blocked
http://www.webpagetest.org/result/160205_GF_2150882829a0d952461aadaa82521306/

From the Chrome waterfall it looks like the overhead of blocking in the extension impacts the test, and the CPU is maxed out (unlike the FF test)

@pmeenan

This comment has been minimized.

Copy link
Contributor

pmeenan commented Mar 28, 2016

Enabling blocking (or modifying request headers) in Chrome is exceedingly expensive because it enables the code path that turns on the use of the blocking webrequest extension API (which seems to have gotten even slower in Chrome over time).

It looks like all of your blocks were FQDN's which could potentially be a fast path and be handled at the DNS layer instead. Unfortunately the block feature allows for blocking a substring anywhere in the URL but if I split the blocking into 2 fields (one for substrings and one for domains) would that meet your needs? That would match the capability on mobile anyway which can only block at the fqdn level.

@andydavies

This comment has been minimized.

Copy link
Contributor Author

andydavies commented Mar 29, 2016

Blocking at the fqdn level would most of the needs for this use case - which is to show someone the impact 3rd parties are having on their site's performance (makes a good demo)

I knew Chrome and FF did the blocking differently but while I've delved into the Chrome extension, I've never really looked at the DNS stuff - perhaps it's time I learnt!

There's no rush on this, I filled the issue so it didn't get lost - I've been aware of it for a while but thought others might not be.

@pmeenan

This comment has been minimized.

Copy link
Contributor

pmeenan commented Aug 11, 2016

Just rolled out 2 new commands in wptdriver 300 that operate at the DNS level (no overhead).

blockDomains - Takes a space-delimited list of fqdn's to block

blockDomainsExcept - Takes a space-delimited list of fqdn's and blocks anything not on the list (white list).

@pmeenan pmeenan closed this Aug 11, 2016

@andydavies

This comment has been minimized.

Copy link
Contributor Author

andydavies commented Aug 12, 2016

Thanks Pat,

I presume this only available the script level rather than the web UI box - as the blocking list can contain wildcards.

Got a half written post about using blocking that I need to finish so will include this too.

@pmeenan

This comment has been minimized.

Copy link
Contributor

pmeenan commented Aug 12, 2016

Yes, currently it is only available through scripting but expanding that is trivial and I may try over the weekend (OOTO today).

Going to re-open as there are a few more things I want to do with it:

  • Add input fields in the block tab of the UI for the domain black and white lists (and the matching API fields)
  • Add mobile agent support for the blockDomains command (since that's effectively what it does for block today)
  • Add support for specifying regex's to the domain list i.e. /^.*mydomain.com$/ (desktop only)

@pmeenan pmeenan reopened this Aug 12, 2016

@pmeenan pmeenan closed this in 2c18b4c Feb 10, 2017

@pmeenan

This comment has been minimized.

Copy link
Contributor

pmeenan commented Feb 10, 2017

@abarre

This comment has been minimized.

Copy link
Contributor

abarre commented May 26, 2017

@pmeenan, I'm not sure of the final status of this feature.
Do you confirm that block is functional in Chrome or do you advise to use blockDomains for Chrome ?

@pmeenan

This comment has been minimized.

Copy link
Contributor

pmeenan commented May 26, 2017

block should be functional in Chrome (desktop and mobile) and uses the built-in support with Network.setBlockedURLs. There's been a report or tow of it not working as expected though so I need to make sure it is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment