[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] OSCFunc oneShot is breakable because of careless FunctionList implementation

On 10.12.2013, at 14:09, Scott Wilson <i@xxxxxxxxxxxxxx> wrote:

> On 10 Dec 2013, at 12:55, "Kuivila, Ronald" <rkuivila@xxxxxxxxxxxx> wrote:
>> Hi James and Scott,
>> Is the alternative of copying the array before iterating obviously worse in performance?
>> As in 
>> value { arg ... args;
>> var res = array.copy.collect(_.valueArray(args));
>> ^if(flopped) { res.flop } { res }
>> }
> I guess it's one of those concerns about adding cost to every evaluation, rather than only when needed.
> That said, as far as the OSCFunc case goes, I'd think the case of multiple functions for the same path is rare, so it wouldn't happen all the time anyway. It would also be more consistent.

I agree that the most general and safe way would be to copy the array. Although it creates a little bit of overhead, this is not overly slow, and used in various places in the system.
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/