emacs-devel
[Top][All Lists]
Advanced

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

Re: User-reserved element in byte code vectors


From: Miles Bader
Subject: Re: User-reserved element in byte code vectors
Date: Sat, 22 May 2004 05:37:15 -0400
User-agent: Mutt/1.3.28i

On Sat, May 22, 2004 at 03:31:54AM -0400, Richard Stallman wrote:
>     >        (let ((env (vector 0)))
>     >          (curry env (lambda (env) (aset env 0 (+ (aref env 0) 1)))))
> 
> Wouldn't it be better to add an env slot to byte-compiled functions?
> No matter how the code implements that, it ought to be somewhat faster.

a new closure/environment is created ever time you invoke the above code, but
the actual code-object representing the lambda is a constant.  This is why
it's natural to use a representation where the closure actually points to the
code-object, rather than the other way around.

I don't there'd be much speed avantage to a call using the opposite method --
the overhead of using curry is basically an extra layer of Ffuncall before
getting to Fbyte_code.  [In the extremely unlikely case that it _was_ an
issue, you could simply have funcall_funvec call Fbyte_code directly when
appropriate.]

BTW, while this is an interesting subject, what about the basic funvec/curry
patch?

-Miles
-- 
(\(\
(^.^)
(")")
*This is the cute bunny virus, please copy this into your sig so it can spread.




reply via email to

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