Re: New proposal for fixing race conditions

On Thu, Jul 25, 2013 at 12:56 PM, Marcus Geelnard <mage@opera.com> wrote:

> Hi Olivier,
>
>
> On Wed, Jul 24, 2013 at 1:02 PM, Olivier Thereaux <
> Olivier.Thereaux@bbc.co.uk> wrote:
>
>> Hi all,
>>
>> On 23/07/2013 17:11, "Chris Wilson" <cwilso@google.com> wrote:
>>
>> * the cost of the proposed solutions (e.g "I doubt that memcpy will do
>> much harm" versus "quite a heavy weight on interacting with audio buffer
>> data").
>>
>>
>>
> I would like to see some more facts on the table here too.
>
> I hope that I have shown that:
>
> 1) The speed impact of memcpy is negligible.
>
> 2) For the use cases I've considered so far the additional memory impact
> is temporary and transient, and shouldn't prevent any use case.
>
> I think that any concrete examples showing the opposite would be valuable
> to this discussion.
>

As I've mentioned before, it's not the cost of the memcpy() itself, but the
memory footprint.

PCM audio data in an AudioBuffer is 20Mb per minute for stereo @44.1KHz.
 The cost is more than double for professional quality 96Khz data.

In an audio analysis or editor application, it wouldn't be at all unusual
to examine or display minutes of audio at a time.  Typical songs are 2 - 4
minutes long, and it wouldn't be unusual to deal with editing multiple
songs at a time.  Even with a total length of audio data of only 10
minutes, we're already at 200Mb for the contents of the data.  Now think
about what happens when it's necessary to create copies of that data, and
we're now dealing with 400Mb!  Mobile devices are quite memory constrained,
with even some relatively recent devices such as the iPhone 4 and similar
Android devices having only 500Mb total RAM.  Keep in mind that not all of
this memory will be available for audio data, since much of it is required
for the resident system software, and other applications.

Unless we're talking about memory leaks, all memory allocations are
temporary or transient, but their effect on system performance is not, with
VM system swapping entering into the picture, degrading the entire device's
performance.

Chris


>
>
> /Marcus
>
>
>
>> Olivier
>>
>>
>>
>> -----------------------------
>> http://www.bbc.co.uk
>> This e-mail (and any attachments) is confidential and
>> may contain personal views which are not the views of the BBC unless
>> specifically stated.
>> If you have received it in
>> error, please delete it from your system.
>> Do not use, copy or disclose the
>> information in any way nor act in reliance on it and notify the sender
>> immediately.
>> Please note that the BBC monitors e-mails
>> sent or received.
>> Further communication will signify your consent to
>> this.
>> -----------------------------
>>
>
>

Received on Thursday, 25 July 2013 20:31:26 UTC