|
![](/i/fill.gif) |
On 20.01.10 13:13, makc wrote:
> Thorsten Froehlich<tho### [at] trf de> wrote:
>> You are overlooking it: What you want is "select"
>
> Wow thanks, that does give some noticeable boost (and so hope to it).
>
> Re sum/prod, can't see how that is different, except that I can put expression
> as argument vs it being function body. Is it faster that way?
Indeed, the overhead is somewhat lower than for a function call (due to the
internal structure of the function VM). What you need to know is that you
can you the local variable as the end value, i.e.
sum(i, ... compute variable i ..., i, ... your function here ...)
That way the sum function iterates exactly once. This works because i is
initialized as soon as the start value is computed, hence it can be used by
the end value computation, which is only computed once, too.
Thorsten
Post a reply to this message
|
![](/i/fill.gif) |