Hi.
I'm using DataChannel to transfer a large file to another peer. While monitoring the performance of my javascript (in chrome v71) I notice channel.send(uInt8Array) takes up the most of the scripting time
I assume that it has to has to copy the ArrayBufferView and that is why it block the main thread for a bit? since i might still have a reference to it somewhere... Now my proposal is make it optional to make it transferable just like postMessage is able to do.
port1.postMessage(message, [transfer])dataChannel.send(message, [transfer])
I don't need the data after that point so there is no need for it to be copied. it would also help to free memory
Copied from Issue https://github.com/w3c/webrtc-pc/issues/2055
Hi. I'm using DataChannel to transfer a large file to another peer. While monitoring the performance of my javascript (in chrome v71) I notice
channel.send(uInt8Array)
takes up the most of the scripting timeI assume that it has to has to copy the ArrayBufferView and that is why it block the main thread for a bit? since i might still have a reference to it somewhere... Now my proposal is make it optional to make it transferable just like postMessage is able to do.
port1.postMessage(message, [transfer])
dataChannel.send(message, [transfer])
I don't need the data after that point so there is no need for it to be copied. it would also help to free memory