At 11:50 2006-06-02, you wrote: >On Fri, 02 Jun 2006 09:22:29 +0200, Ola Bini wrote: > > 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... > >This is a good idea, but ObjectSpaceIterator already skips null values, >so I don't think there is a need to cleanup every time iterator() is >called, much less every add. If iterator() is called often enough I would >suggest moving the cleanup operation into a separate daemon thread that >kicks in every so often instead. > >If cleanup can be made less frequent, you could change it to build up >a new references collection by iterating and looking for nulls. This would >allow you to get rid of ReferenceQueue and make references an ArrayList >instead of a HashSet. > >I'd test this out myself but I'm not sure what to use as a benchmark. >Could someone give me a pointer? Maybe a "benchmark" Ant target would >come in handy. > >Chris > >
Actually, if you want to, the ObjectSpaceIterator itself could remove those null values instead, since we're already iterating over the collection. No need for expensive threads. /O _______________________________________________ Jruby-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jruby-devel
