Csound Csound-dev Csound-tekno Search About

[Cs-dev] andoid list iterator

Date2014-11-22 10:53
FromConstanze
Subject[Cs-dev] andoid list iterator
Attachmentsmem1.png  None  None  
Hi csound-dev

we're using csound for android, and during memory analysis I noticed 
that approx half of the memory allocations my app does are for the list 
iterators in function runCsoundOpenSL. Hope you can see the attached 
screenshot. The two inner for-each loops iterate over the ArrayList 
valuesCache are each allocating 24 bytes very frequently in my app.  
According to 
http://developer.android.com/training/articles/perf-tips.html#Loops it 
is not efficient to use for-each loops for ArrayLists. Maybe you should 
consider using a different loop construct here, I'd expect to improve 
memory performance of my app a lot by avoiding those allocs here.

Also I'd like to use this opportunity to thank you for your effort you 
put in csound, it really works great and we're happy to use it!

Constanze

-- 
hollyhook - adaptive music technology
http://hollyhook.de


Date2014-11-22 11:31
FromVictor Lazzarini
SubjectRe: [Cs-dev] andoid list iterator
Hi Constanze,

can you open an issue on github so we can keep track of this?

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 22 Nov 2014, at 10:53, Constanze  wrote:
> 
> Hi csound-dev
> 
> we're using csound for android, and during memory analysis I noticed that approx half of the memory allocations my app does are for the list iterators in function runCsoundOpenSL. Hope you can see the attached screenshot. The two inner for-each loops iterate over the ArrayList valuesCache are each allocating 24 bytes very frequently in my app.  According to http://developer.android.com/training/articles/perf-tips.html#Loops it is not efficient to use for-each loops for ArrayLists. Maybe you should consider using a different loop construct here, I'd expect to improve memory performance of my app a lot by avoiding those allocs here.
> 
> Also I'd like to use this opportunity to thank you for your effort you put in csound, it really works great and we're happy to use it!
> 
> Constanze
> 
> -- 
> hollyhook - adaptive music technology
> http://hollyhook.de
> 
> 
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net