W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2013

Re: New proposal for fixing race conditions

From: Ehsan Akhgari <ehsan.akhgari@gmail.com>
Date: Tue, 30 Jul 2013 17:35:27 -0400
Message-ID: <CANTur_6m0ujhPF7r_ocvqtHepLMxmFOriWPQfJ1vLR16OGUbrQ@mail.gmail.com>
To: Jussi Kalliokoski <jussi.kalliokoski@gmail.com>
Cc: Jer Noble <jer.noble@apple.com>, "Robert O'Callahan" <robert@ocallahan.org>, Olivier Thereaux <Olivier.Thereaux@bbc.co.uk>, WG <public-audio@w3.org>
On Tue, Jul 30, 2013 at 12:05 PM, Jussi Kalliokoski <
jussi.kalliokoski@gmail.com> wrote:

> On Tue, Jul 30, 2013 at 6:52 PM, Jer Noble <jer.noble@apple.com> wrote:
>
>>
>> On Jul 30, 2013, at 8:47 AM, Jussi Kalliokoski <
>> jussi.kalliokoski@gmail.com> wrote:
>>
>> Does this impose a performance cost on Float32Array access, BTW? I tried
>> figuring it out on my own but I've been following leads in the WebKit
>> source for a while and haven't found the code that does this.
>>
>>
>> We re-used the high-order bit in ArrayBufferView's offset to track
>> non-neuterableness.  So yes, in that offset calculations now need to mask
>> off that bit, but the cost is negligable.
>>
>> See:
>> http://trac.webkit.org/browser/trunk/Source/WTF/wtf/ArrayBufferView.h#L134
>> http://trac.webkit.org/browser/trunk/Source/WTF/wtf/ArrayBuffer.cpp#L36
>>
>
> Thanks! So, correct me if I'm wrong, but we're discussing imposing a
> performance cost (arguably negligible) to Typed Arrays use to avoid
> imposing a performance cost (arguably negligible) on the Web Audio API. To
> be honest, (probably unsurprisingly) I'd rather we take risks like this in
> our own API instead of on an API that's the foundation of high performance
> JS. We can add more surface to our API to make it faster if need be, but if
> we impose performance costs to the basic use of Typed Arrays, that's
> irreversible and damages the whole platform.
>

These are all WebKit (and maybe even WebKit + JSC) implementation details.
And the reason why we have two proposals to fix the shared-memory problem
is the bug that degrades the performance of WebKit + JSC when any neutering
happens.

When discussing how to fix the shared memory problem, we have either Roc's
proposal on the table which doesn't change the API surface but uses
neutering to prevent concurrent accesses to the same buffer, or Jer's
proposal which breaks the API surface and does not use neutering in order
to work around the WebKit + JSC bug.  I personally think that Jer's
solution is a cleaner API, but we have decided to not fix other problems in
the API in order to maintain backwards compatibility, and I would like to
urge everybody to keep the trade-offs in mind when casting their vote.

Cheers,
Ehsan
Received on Tuesday, 30 July 2013 21:36:36 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:03:23 UTC