However, I think a better implementation would be to have ObjectSpace implement an internal ReferenceQueue to immediately remove object references upon collection. That may be the best way to handle all our various uses of WeakReferences, and would then completely eliminate the need for a "clean" method at all.
My guess is that the cost is more in maintaining the HashSet than anything else. Every new object needs to calculate a new Hash, and we've seen in the past that heavy map maintenance--especially in code called a bazillion times--can be a sizeable performance hit.
On 6/2/06, Ola Bini <[EMAIL PROTECTED]> wrote:
Hi,
Regardig the ObjectSpace-implementation, I would recommend you to move the
cleanup call to ObjectSpace#iterator() ... I think that's where most of the
performance go through the roof.
And it's not like those WeakReferences are a problem...
/O
--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ jruby.sourceforge.net
Application Architect @ www.ventera.com
_______________________________________________ Jruby-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jruby-devel
