W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > January 2019

[webrtc-pc] Send transferable data (#2055)

From: Jimmy Wärting via GitHub <sysbot+gh@w3.org>
Date: Sat, 12 Jan 2019 22:40:42 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issues.opened-398599010-1547332841-sysbot+gh@w3.org>
jimmywarting has just created a new issue for https://github.com/w3c/webrtc-pc:

== Send transferable data ==
I'm using DataChannel to transfer a large file to another peer. While monitoring the performance of my javascript i notice `channel.send(uInt8Array)` takes up the most of the scripting time
![skarmavbild 2019-01-12 kl 23 12 58](https://user-images.githubusercontent.com/1148376/51079006-aa1b6f00-16bf-11e9-8ec9-be6a6b8403f8.png)

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

Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2055 using your GitHub account
Received on Saturday, 12 January 2019 22:40:44 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 6 May 2023 21:19:46 UTC