Re: TextTrackCue discussions

On 20 Sep 2013 13:36, "Boris Zbarsky" <bzbarsky@mit.edu> wrote:
>
> On 9/19/13 11:21 PM, Silvia Pfeiffer wrote:
>>
>> Should we keep .text as well, because converting from ArrayBuffer to
>> String can be inefficient, see
>>
http://updates.html5rocks.com/2012/06/How-to-convert-ArrayBuffer-to-and-from-String
>> ?
>
>
> Can we quantify "inefficient"?
>
> The link you have there shows that the direct array manipulation approach
on the system that was tested can convert a 1015-char string to an
ArrayBuffer and back about 30k times per second in a modern browser.  Are
we expecting people to be pushing ~30MB of cue data per second through
conversions to strings?

Hopefully not, though you never know. But it's also about convenience.
.text would be created lazily by the browser, so if the JS dev never needs
it, there is no penalty. If they need it, the browser is always faster and
it's more convenient for the dev. Finally, if the browser knows it's text,
there is no conversion required and direct exposure is more efficient (I.e.
makes your web page faster and frees up cycles for other stuff).

Silvia.

Received on Friday, 20 September 2013 06:54:20 UTC