On Wed, 14 Dec 2004, Harvey J. Stein wrote:

> But, what about in a bigger system?

Well, at a sufficiently high level of abstraction, that little 
boxing overhead will in most cases not be a problem. 

At least, if your function is large and complicated and spends a lot of 
time in calculating, it's negligible.

If not, you can inline it in most cases. :-)

No, I'm not a Fortran guy, but in some cases when this really matters, you 
can circumnavigate such problems by passing to your function a 
(simple-array double-float (*)) and an index where to store its result...

Anyway, for something like random number generation, you may well think 
about alien-funcalling C. But you probably should turn off GC while C is 
in control.

> It seems like declarations can get rid of boxing and unboxing inside
> of functions, but in general not across function calls, unless
> functions are inlined, maybe-inlined, or block compiled.  Is this the
> case?

More or less. At least with (complex double-float) you may also run into 
trouble if you run out of FPU registers. Then again, the system will 
cons numbers.

-- 
regards,               [EMAIL PROTECTED]              (o_
 Thomas Fischbacher -  http://www.cip.physik.uni-muenchen.de/~tf  //\
(lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y)           V_/_
(if (= x 0) y (g g (- x 1) (* x y)))) n 1))                  (Debian GNU)


Reply via email to