Re: Should send() be able to take an ArrayBufferView?

On 4/11/12 5:54 PM, Charles Pritchard wrote:
>> Note that those have different performance characteristics, too; the
>> latter involves a buffer copy.
>
> Are we stuck with a buffer copy (or copy on write) mechanism anyway?

Yes-ish; the question is how many copies there are.

> What is the spec on changing the buffer after xhr.send?

http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-send%28%29-method 
says that the request body is the data in the array buffer when send() 
is called.

Whether that involves a copy depend on whether you get the data down to 
the socket before send() returns, obviously.  In most cases, I would 
assume it would.

Having so slice() means you have to copy twice instead of once.

-Boris

Received on Thursday, 12 April 2012 01:16:07 UTC