On Tue, Apr 1, 2008 at 6:44 AM, John Cowan <[EMAIL PROTECTED]> wrote:
> What are the upsides and downsides of the -lambda-lift switch in csc?
>

The compiler does a simple form of lambda-lifting optmization, which means
lifting internal, known procedures to toplevel and passing any free variables
as extra arguments. So

...
(let ((y 99))
  ...
  (let ((some-func (lambda (x) (print "x: " x ", y: " y))))
   ...
      (some-func whatever)

can be rewritten to

(define <hidden-some-func> (lambda (x y) (print ...)))

...

(let ((y 99))
  ...
  ...
  (<hidden-some-func> whatever y)

This can improve performance in certain situations. In my experience
it doesn't make much of a difference, but chicken's lambda-lifter does
only optimize the simplest cases. You have to try out whether it gives
any improvements.


cheers,
felix


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to