[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 Dec 2013, at 16:23, Julian Rohrhuber <julian.rohrhuber@xxxxxxxxxxxxxxxxxx> wrote:

> 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.

I think I probably agree. In most cases it will be a single function anyway, so no hit. In cases where it's not, many (possibly most) will not be high load, but rather one offs etc., so won't really matter. In cases where maximum performance is required there is the option of using a custom dispatcher (which is after all available for just such occasions).

The only question is if there are other uses of FunctionList where this would matter more.

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/