Performance regressions with client hints |
||||
Issue descriptionFrom 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.
,
Sep 25 2017
,
Oct 26 2017
,
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
,
Oct 26 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by tbansal@chromium.org
, Sep 25 2017