guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: continuation efficiency


From: Martin Grabmueller
Subject: Re: continuation efficiency
Date: Sat, 07 Jul 2001 10:23:56 +0200

> From: address@hidden (Thomas Bushnell, BSG)
> Date: 06 Jul 2001 17:53:35 -0700
> 
> Marius Vollmer <address@hidden> writes:
> 
> > Actually, I think we should have call/ec as a builtin.  
> 
> If call/ec is not already a builtin, how is it actually faster than
> call/cc?

call/cc does a full copy of the machine stack, to be able to install
it again when the continuation is invoked.  This requires memory
allocation and copying, which is a bit slow.

call/ec, on the other hand, does not need to preserve the stack, since
it only allows calls upwards in the call chain.  Think of call/ec as
throw/catch and you'll see.  So call/ec is less powerful, but faster
(in Guile, other Schemes may vary).

Regards,
  'martin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]