Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Issue 20135002: Optimize WebURL -> GURL conversions (Closed)

Created:
7 years, 5 months ago by abarth-chromium
Modified:
7 years, 4 months ago
CC:
blink-reviews, jamesr, eae+blinkwatch, dglazkov+blink, tommyw+watchlist_chromium.org, jeez
Visibility:
Public.

Description

Optimize WebURL -> GURL conversions When rendering sina.com.cn, we spend 5% of our total time converting between WebURL and GURL. Prior to this CL, the conversion involved a number of copies: 1) From the String to a temporary buffer in String::utf8. 2) From the temporary buffer to a CString. 3) From the CString to a std::string. After this CL, we are able to copy directly from the String into the GURL. Instead of WebURL storing the spec in a CString, we now store the spec as a String, which lets WebURL simply ref the same buffer used by KURL. When building the GURL, we copy directly out of the String (assume it's ASCII, which is usually the case for canonicalized URLs) into a temporary std::string, which we move all the way into the GURL. R=jyasskin@chromium.org BUG=261412 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155006

Patch Set 1 #

Total comments: 4

Patch Set 2 : Fix logic #

Total comments: 3

Patch Set 3 : Remove operator< #

Total comments: 2

Patch Set 4 : Hijack WebString::utf8 #

Patch Set 5 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -41 lines) Patch
M Source/core/platform/chromium/support/WebURL.cpp View 1 2 3 4 3 chunks +3 lines, -3 lines 0 comments Download
M Source/weborigin/KURL.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/weborigin/KURL.cpp View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M public/platform/WebURL.h View 1 2 3 4 4 chunks +30 lines, -35 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
abarth-chromium
7 years, 5 months ago (2013-07-24 20:59:27 UTC) #1
Jeffrey Yasskin
https://codereview.chromium.org/20135002/diff/1/public/platform/WebURL.h File public/platform/WebURL.h (right): https://codereview.chromium.org/20135002/diff/1/public/platform/WebURL.h#newcode124 public/platform/WebURL.h:124: return isNull() ? GURL() : GURL(m_string.toUTF8String(), m_parsed, m_isValid); In ...
7 years, 5 months ago (2013-07-24 21:23:51 UTC) #2
abarth-chromium
https://codereview.chromium.org/20135002/diff/1/public/platform/WebURL.h File public/platform/WebURL.h (right): https://codereview.chromium.org/20135002/diff/1/public/platform/WebURL.h#newcode124 public/platform/WebURL.h:124: return isNull() ? GURL() : GURL(m_string.toUTF8String(), m_parsed, m_isValid); On ...
7 years, 5 months ago (2013-07-24 21:57:34 UTC) #3
abarth-chromium
PTAL
7 years, 5 months ago (2013-07-24 21:58:35 UTC) #4
abarth-chromium
https://codereview.chromium.org/20135002/diff/6001/public/platform/WebString.h File public/platform/WebString.h (right): https://codereview.chromium.org/20135002/diff/6001/public/platform/WebString.h#newcode94 public/platform/WebString.h:94: BLINK_COMMON_EXPORT std::string toUTF8String() const; I'm not super happy with ...
7 years, 5 months ago (2013-07-24 21:59:10 UTC) #5
Jeffrey Yasskin
lgtm https://codereview.chromium.org/20135002/diff/6001/public/platform/WebString.h File public/platform/WebString.h (right): https://codereview.chromium.org/20135002/diff/6001/public/platform/WebString.h#newcode94 public/platform/WebString.h:94: BLINK_COMMON_EXPORT std::string toUTF8String() const; On 2013/07/24 21:59:10, abarth ...
7 years, 5 months ago (2013-07-24 22:23:20 UTC) #6
eseidel
lgtm looks reasonable. https://codereview.chromium.org/20135002/diff/6001/Source/core/platform/chromium/support/WebString.cpp File Source/core/platform/chromium/support/WebString.cpp (right): https://codereview.chromium.org/20135002/diff/6001/Source/core/platform/chromium/support/WebString.cpp#newcode111 Source/core/platform/chromium/support/WebString.cpp:111: return m_private.get() < s.m_private.get(); This looks ...
7 years, 5 months ago (2013-07-24 22:56:16 UTC) #7
abarth-chromium
On 2013/07/24 22:56:16, eseidel wrote: > lgtm > > looks reasonable. > > https://codereview.chromium.org/20135002/diff/6001/Source/core/platform/chromium/support/WebString.cpp > ...
7 years, 5 months ago (2013-07-24 23:08:38 UTC) #8
abarth-chromium
This CL now depends on https://codereview.chromium.org/20101007 as well.
7 years, 5 months ago (2013-07-24 23:10:04 UTC) #9
darin (slow to review)
https://codereview.chromium.org/20135002/diff/13001/public/platform/WebString.h File public/platform/WebString.h (right): https://codereview.chromium.org/20135002/diff/13001/public/platform/WebString.h#newcode93 public/platform/WebString.h:93: BLINK_COMMON_EXPORT std::string toUTF8String() const; This is sort of a ...
7 years, 5 months ago (2013-07-24 23:16:50 UTC) #10
jamesr
Now that WebString can efficiently handle 1 byte strings, is there any reason to have ...
7 years, 5 months ago (2013-07-24 23:18:32 UTC) #11
abarth-chromium
https://codereview.chromium.org/20135002/diff/13001/public/platform/WebString.h File public/platform/WebString.h (right): https://codereview.chromium.org/20135002/diff/13001/public/platform/WebString.h#newcode93 public/platform/WebString.h:93: BLINK_COMMON_EXPORT std::string toUTF8String() const; On 2013/07/24 23:16:51, darin wrote: ...
7 years, 5 months ago (2013-07-24 23:22:42 UTC) #12
abarth-chromium
In code search, I don't see any obvious reasons for WebCString to exist. Maybe we ...
7 years, 5 months ago (2013-07-24 23:25:37 UTC) #13
darin (slow to review)
That sounds pretty good to me! On Wed, Jul 24, 2013 at 4:25 PM, <abarth@chromium.org> ...
7 years, 5 months ago (2013-07-24 23:26:39 UTC) #14
abarth-chromium
On 2013/07/24 23:26:39, darin wrote: > That sounds pretty good to me! At darin's suggestion, ...
7 years, 5 months ago (2013-07-24 23:36:57 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/abarth@chromium.org/20135002/25001
7 years, 4 months ago (2013-07-26 16:55:51 UTC) #16
commit-bot: I haz the power
7 years, 4 months ago (2013-07-26 19:54:52 UTC) #17
Message was sent while issue was closed.
Change committed as 155006

Powered by Google App Engine
This is Rietveld 408576698