[webkit-dev] XHR responseArrayBuffer attribute
Chris Marrin
cmarrin at apple.com
Tue Sep 28 07:18:08 PDT 2010
On Sep 27, 2010, at 6:40 PM, James Robinson wrote:
> On Mon, Sep 27, 2010 at 6:37 PM, Maciej Stachowiak <mjs at apple.com> wrote:
>
> On Sep 27, 2010, at 3:19 PM, Michael Nordman wrote:
>
>> Webkit's XHR currently does not keep two copies of the data that I can see. I think we should avoid that.
>
> We could keep the raw data around, which hopefully is directly usable as an ArrayBuffer backing store, and only translate it to text format when/if the client requests responseText.
>
>
> It would be unfortunate to have to keep the raw data around after the page access .responseText, given that the overwhelming majority of pages will touch .responseText and nothing else. I found when improving the V8 XHR implementation that the memory footprint of .responseText being held off of the XHR object itself was often significant so I would be very reluctant to grow it by an addition 50-100% (depending on encoding) in the common case.
But do you think you'd ever need more than one copy of the raw bits from the response? Seems like you should be able to return a responseText and a responseArrayBuffer from the same raw bits. Am I missing some detail of how XHR works?
-----
~Chris
cmarrin at apple.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20100928/c42aa1ec/attachment.html>
More information about the webkit-dev
mailing list