[plt-scheme] cost of closure?

From: YC (yinso.chen at gmail.com)
Date: Thu May 31 19:46:32 EDT 2007

On 5/31/07, Matthew Flatt <mflatt at cs.utah.edu> wrote:
>
> > At Thu, 31 May 2007 16:31:28 -0700, YC wrote:
> > > While it's unclear for me what model PLT Scheme uses for structs -
> Robby
> > > alluded to that closures is only a constant factor over struct from
> memory
> > > consumption.
>
> > I think that constant factor should be between 0 and 1 pointer,
> > depending on whether the closure refers to top-level bindings or module
> > top-level bindings (other than things that are built into MzScheme, in
> > which case the reference is inlined instead of kept in the closure).
>
> > Otherwise, a closure has a pointer to its code, and a struct has a
> > pointer to it's type descriptor, so those balance; each field and
> > captured bindings take the same amount of space.


That's not bad at all... ;)

Thanks,
yinso
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20070531/35dd8757/attachment.html>

Posted on the users mailing list.