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

Re: S&I's idea of EQ? (long)

JINX's analysis is valid, but I disagree with the conclusion that
since closures are (roughly) ``no more expensive than conses'' that
they are not worth optimizing.  It is easy to construct examples of
``inner loops'' in which such consing dominates the execution time.
I've investigated these optimizations precisely because of my
experience with real programs that needed such help.

One such program worked exclusively with numbers we are able to
represent as immediates (no number consing), yet mystified its author
because of occasional GCs.  (The GCs were unexpected because the
generated code managed to allocate all variables to registers,
avoiding use of the heap.)  We'll never supplant Pascal that way!

My goal is to develop implementations of Scheme that rival other
languages in performance without sacrificing those things that make
Scheme so desirable a language in the first place.  In this case, I
feel that the balance tips in favor of allowing useful optimizations
to take place.

It seems that any final decision on this point will come down to
trading off potential performance for certain semantic ideals.  I
guess I'm as unconvinced by some of the arguments against coalescing
as others are by my concerns about performance!

David Bartley