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

Issue 16925002: XMLHttpRequest#responseText should use a rope (Closed)

Created:
7 years, 6 months ago by abarth-chromium
Modified:
7 years, 6 months ago
Reviewers:
jamesr
CC:
blink-reviews, eustas+blink_chromium.org, caseq+blink_chromium.org, aandrey+blink_chromium.org, loislo+blink_chromium.org, jsbell+bindings_chromium.org, pfeldman+blink_chromium.org, alph+blink_chromium.org, eae+blinkwatch, yurys+blink_chromium.org, lushnikov+blink_chromium.org, vsevik+blink_chromium.org, marja+watch_chromium.org, apavlov+blink_chromium.org, adamk+blink_chromium.org, haraken, Nate Chapin
Visibility:
Public.

Description

XMLHttpRequest#responseText should use a rope Instead of building a flat WTF::String from XMLHttpRequest response data, we should build a v8::String rope. That way when web sites query the responseText field repeatedly, every query will share the same underlying data. This CL causes StringImpl::hashSlowCase to drop way down the CPU profile of reloading Mobile Gmail: Before: 1.08% content_shell content_shell [.] WTF::StringImpl::hashSlowCase() const After: 0.37% content_shell content_shell [.] WTF::StringImpl::hashSlowCase() const There are likely other savings as well, but the effect on StringImpl::hashSlowCase is the most dramatic change to the profile. R=jamesr Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=152380

Patch Set 1 #

Total comments: 2

Patch Set 2 : Compiles, does not pass tests #

Patch Set 3 : Passes tests #

Patch Set 4 : Rebase #

Total comments: 6

Patch Set 5 : Address reviewer feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -60 lines) Patch
M Source/bindings/bindings.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
A + Source/bindings/v8/ScriptString.h View 1 2 3 4 1 chunk +12 lines, -17 lines 0 comments Download
A + Source/bindings/v8/ScriptString.cpp View 1 2 3 4 1 chunk +14 lines, -13 lines 0 comments Download
M Source/bindings/v8/custom/V8XMLHttpRequestCustom.cpp View 1 2 1 chunk +6 lines, -2 lines 0 comments Download
M Source/core/inspector/InspectorConsoleAgent.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/inspector/InspectorConsoleAgent.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/inspector/InspectorInstrumentation.h View 1 2 chunks +4 lines, -3 lines 0 comments Download
M Source/core/inspector/InspectorInstrumentation.idl View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/inspector/InspectorResourceAgent.h View 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/inspector/InspectorResourceAgent.cpp View 1 2 3 4 2 chunks +4 lines, -4 lines 0 comments Download
M Source/core/xml/XMLHttpRequest.h View 4 chunks +6 lines, -5 lines 0 comments Download
M Source/core/xml/XMLHttpRequest.cpp View 1 2 3 4 6 chunks +9 lines, -11 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
abarth-chromium
@jamesr: Here's a work-in-progress patch to bring back your original optimization. I haven't even tried ...
7 years, 6 months ago (2013-06-13 05:44:12 UTC) #1
jamesr
nifty! https://codereview.chromium.org/16925002/diff/1/Source/bindings/v8/ScriptString.cpp File Source/bindings/v8/ScriptString.cpp (right): https://codereview.chromium.org/16925002/diff/1/Source/bindings/v8/ScriptString.cpp#newcode43 Source/bindings/v8/ScriptString.cpp:43: return ScriptString(v8::String::Concat(a, )); (a, b), i presume? :)
7 years, 6 months ago (2013-06-13 05:49:36 UTC) #2
abarth-chromium
https://codereview.chromium.org/16925002/diff/1/Source/bindings/v8/ScriptString.cpp File Source/bindings/v8/ScriptString.cpp (right): https://codereview.chromium.org/16925002/diff/1/Source/bindings/v8/ScriptString.cpp#newcode43 Source/bindings/v8/ScriptString.cpp:43: return ScriptString(v8::String::Concat(a, )); On 2013/06/13 05:49:36, jamesr wrote: > ...
7 years, 6 months ago (2013-06-13 05:56:12 UTC) #3
jamesr
That would require caching the V8 handles for each conversion, right? Otherwise we'd have a ...
7 years, 6 months ago (2013-06-13 05:59:09 UTC) #4
abarth-chromium
On 2013/06/13 05:59:09, jamesr wrote: > That would require caching the V8 handles for each ...
7 years, 6 months ago (2013-06-13 17:08:36 UTC) #5
abarth-chromium
@jamesr: This CL is ready for review now.
7 years, 6 months ago (2013-06-13 18:47:27 UTC) #6
jamesr
lgtm https://codereview.chromium.org/16925002/diff/13001/Source/bindings/v8/ScriptString.h File Source/bindings/v8/ScriptString.h (right): https://codereview.chromium.org/16925002/diff/13001/Source/bindings/v8/ScriptString.h#newcode43 Source/bindings/v8/ScriptString.h:43: ScriptString(v8::Handle<v8::String> value) : ScriptValue(value) { } probably want ...
7 years, 6 months ago (2013-06-13 19:28:42 UTC) #7
abarth-chromium
https://codereview.chromium.org/16925002/diff/13001/Source/bindings/v8/ScriptString.h File Source/bindings/v8/ScriptString.h (right): https://codereview.chromium.org/16925002/diff/13001/Source/bindings/v8/ScriptString.h#newcode43 Source/bindings/v8/ScriptString.h:43: ScriptString(v8::Handle<v8::String> value) : ScriptValue(value) { } On 2013/06/13 19:28:42, ...
7 years, 6 months ago (2013-06-13 19:38:53 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/abarth@chromium.org/16925002/19001
7 years, 6 months ago (2013-06-13 19:50:38 UTC) #9
commit-bot: I haz the power
7 years, 6 months ago (2013-06-13 21:19:42 UTC) #10
Message was sent while issue was closed.
Change committed as 152380

Powered by Google App Engine
This is Rietveld 408576698