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

Closures (addendum)



By the way, on the Vax, at least, it is not necessarily the case that
dynamic closures cost you an extra cycle on every special variable
reference.  When you pick up a special value, you have to check for the
unbound marker anyway, and if things are arranged properly this same
check can pick off the case of an EVC-pointer or whatever.  So the only
extra cost is on function entry or when you actually do have a ref to a
closed-over or unbound special.  If there were no checking at all of the
special value before returning it, then the EVC-forward check would
indeed cost you a cycle.  Perhaps Hedrick is picking off unbound
specials some other way (or not at all?) and the closure cost is
therefore real to him.  Evan if it cost a whole cycle per special ref,
I'm not sure that that would slow the language down noticeably, since
specials are somewhere down below 10% of all variable refs in the
assorted statistics I've seen.  We can't let them become aribitrarily
bad, but maybe an extra cycle or two is tolerable.

As I said, if we can get the same effect with lexical vars, we should do
it that way.

-- Scott