[whatwg/streams] Performance problem when transferring an ArrayBuffer (#731)

Hi,

I am using the reference implementation for the [Deezer](https://www.deezer.com)'s player (yes, I am aware that may be dangerous 😃 ). I was using an [old revision](https://github.com/whatwg/streams/commit/25839ccc493f2e673b5a5e6370678a54e31fe260) and wanted to update to [the latest](https://github.com/whatwg/streams/commit/8597d3c68c7dc4352e344fb7e4f01d4596124d44).

I noticed a performance problem caused by a [recent commit](https://github.com/whatwg/streams/commit/480b2a364e7f2d2532befed032f597719d05cfa5) (thanks `git bisect`). It seems that now when an ArrayBuffer is transferred it is cloned using slice. As far as I tested, Chrome doesn't like it, with the CPU stalling at 100% when playing music (the previous CPU usage was insignificant).

By the way, why not using [ArrayBuffer.transfer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/transfer)?

Is this a normal behaviour (meaning I should update my code) or an unintended regression (not sure we can say "regression" for a work in progress)?

Many thanks!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/731

Received on Monday, 10 April 2017 13:29:30 UTC