[plt-scheme] cost of closure?

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Thu May 31 17:54:22 EDT 2007

On 5/31/07, YC <yinso.chen at gmail.com> wrote:
> what is the cost of a closure versus say a vector or a struct?  I am trying
> to understand whether closure-based object system scales better than
> struct-based object systems, i.e. can we have thousands or millions of
> closures without issues.

In principle, a closure is essentially a struct.  All that needs to be
stored is a code pointer and references to any free variables.  How
efficient this is in practice depends a lot on the particular
implementation.  Are you asking in general, or about PLT Scheme

Carl Eastlund

Posted on the users mailing list.