Closed Bug 611647 Opened 9 years ago Closed 9 years ago

Use stringbuffer when creating responseText for XMLHttpRequest

Categories

(Core :: DOM: Core & HTML, defect)

x86
All
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: smaug, Assigned: smaug)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

With stringbuffer we can reduce memcpy and actually share data with
JS engine.
This way we can reduce memcpy quite a bit in common case.

Testcase is in bug 611320. Depending on the machine the patch speeds up that
testcase 25%-50%.
Attachment #490085 - Flags: review?(bzbarsky)
Comment on attachment 490085 [details] [diff] [review]
something like this

r=me, though if we didn't care about the overestimate we could also just allocate sufficient capacity and then BeginWriting...  Ah well; in the common case this is not an issue.
Attachment #490085 - Flags: review?(bzbarsky) → review+
Attachment #490085 - Flags: approval2.0?
Attachment #490085 - Flags: approval2.0? → approval2.0+
http://hg.mozilla.org/mozilla-central/rev/78d9167f4372
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.