Re: [Rd] overhead of function calls

2006-11-18 Thread Prof Brian Ripley
On Sat, 18 Nov 2006, Tamas K Papp wrote: > Hi, > > Profiling shows that 65-70% of the time of my program is spent inside > a single function -- this is not surprising, as it is inside an > optimize call inside a loop (this is a dynamic programming problem). > I would like to speed this up. > > The

Re: [Rd] overhead of function calls

2006-11-18 Thread Gabor Grothendieck
I don't know if this would have an appreciable effect or not but you could also check whether passing the free variables explicitly speeds it up so that they don't have to be looked up each time in the outside environment. On 11/18/06, Tamas K Papp <[EMAIL PROTECTED]> wrote: > Hi, > > Profiling sh

[Rd] overhead of function calls

2006-11-18 Thread Tamas K Papp
Hi, Profiling shows that 65-70% of the time of my program is spent inside a single function -- this is not surprising, as it is inside an optimize call inside a loop (this is a dynamic programming problem). I would like to speed this up. The function does very little: has a single argument, evalu