New issue
Advanced search Search tips

Issue 768583 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Mac
Pri: 1
Type: Bug



Sign in to add a comment

Performance regressions with client hints

Project Member Reported by tbansal@chromium.org, Sep 25 2017

Issue description

From https://bugs.chromium.org/p/chromium/issues/detail?id=768393#c1:

1. Calling client_hints::GetAllowedClientHintsFromSource with a WebURL does a string copy to move away from WTFString.

2. Calling IsOriginSecure on a GURL does half a dozen scans of the URL, a bunch of string copies, and an allocation of a new URL with GetOrigin :(

3. GetAllowedClientHintsFromSource calls GURL(url).GetOrigin(), which could be written as url.GetOrigin and remove a string copy. Additionally, IsOriginSecure already gets the origin so we're doing double work.
 
Blocking: -768393
Cc: csharrison@chromium.org
Labels: -M-63 M-64
Status: Started (was: Assigned)
Project Member

Comment 4 by bugdroid1@chromium.org, Oct 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2f3eb341b170543509f9f3c8ada31b63f52bb5b3

commit 2f3eb341b170543509f9f3c8ada31b63f52bb5b3
Author: Tarun Bansal <tbansal@chromium.org>
Date: Thu Oct 26 18:22:09 2017

Remove extra copy construction of GURL in client hints

Also, early return before doing the copy construction if
no persistent client hints are available.

Bug:  768583 
Change-Id: I34d69a4805d45ec1f48c96d6621eb0f981491044
Reviewed-on: https://chromium-review.googlesource.com/737651
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511887}
[modify] https://crrev.com/2f3eb341b170543509f9f3c8ada31b63f52bb5b3/chrome/common/client_hints/client_hints.cc
[modify] https://crrev.com/2f3eb341b170543509f9f3c8ada31b63f52bb5b3/chrome/renderer/content_settings_observer.cc

Status: Fixed (was: Started)

Sign in to add a comment