On 6/5/06, Ola Bini <[EMAIL PROTECTED]> wrote:

The point of this exercise being that it _should_ be dead fast to create
a new WeakReference, and add at the end of an arraylist. If something
actually wants to iterate over ObjectSpace, this will be slower, since
we do both cleanup and hash all the objects we have references too. But
this hit will only be for those using ObjectSpace.

What d'you think?

Seems like a no-brainer to me!  I agree that object creation should not be burdened with reference cleanup.

Could you go even simpler and do away with the reference queue and the cleanup method?  You could incrementally clean the queue during the prefetch method, so that if you didn't iterate through the entire object space, you still wouldn't incur the cost of checking every reference.

Example patch attached -- for illustrative purposes only, please test it.  I did run the unit test suite and a few tests failed -- I don't know if this is the norm.

/Nick

Attachment: ObjectSpace.patch
Description: Binary data

_______________________________________________
Jruby-devel mailing list
Jruby-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to