On Sat, Jan 30, 2010 at 3:12 AM, Waldek Hebisch <hebisch@math.uni.wroc.pl> wrote:
Yes, typically copy is cheap enough.  But in this case main operations
are adding 1 and multiplication by fixnum.  Adding 1 costs basically
the same as copy.  Multiplication by fixnum is slightly more expensive,
but should be no more expensive than two copies.

Waldek, sorry if I sound rude, but really, you are talking out of conjectures without paying attention to my previous emails. I told you the results from profiling when using registers: 80% time on my Mac is spent in the garbage collection routine (most of it in the conservative mark phase), 10% in allocation, 10% in the bignum library or less. Now without registers those numbers only changed by 5% or so. I also offered you the numbers from a 64-bits platform where the garbage collector is much better because pointers are very much more spread and only a tiny fraction of the address space is filled. There ECL can beat SBCL without problems, and I bet the profiling numbers regarding garbage collection are still large.

You mean that ECL _always_ shrinks register if it gets large?  That
looks like huge waste.  It looks like nice opportunity to use
weak references: keep weak reference to register and let garbage
collector to recycle it.  But before garbage collection register
would still be available for reuse.

The Boehm-Weiser garbage collector can be triggered at any time. We do not have control on that, specially on multithreaded systems. Thus to decide whether we kill or not a bignum register is used is something out of our control. But most important, if the garbage collector decides a register is not reachable and garbage collects it, then we will have to allocate it again, which is a cost one avoids by having the register in the first place.

In any case, I repeat that this is all talk of the past. Bignum registers are now only restricted to FLOOR & co, bignum reading, and a few other routines. And times have not changed that much due to this.


Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)