Re: [Jruby-devel] ObjectSpace, again.

2006-07-08 Thread Charles O Nutter
An implementation idea occurred to me that I may not have time to implement tonight. It must be recorded for posterity.One big issue with the current ObjectSpace is the HashSet used to hold all those WeakRefs. So each object that's created gets a WeakRef added to the hashset. When the object is col

Re: [Jruby-devel] ObjectSpace, again.

2006-07-07 Thread Charles O Nutter
I gave this impl a shot and it didn't speed up what I was testing, gem's generation of ri and rdoc for rake. That's not to say it isn't faster, but it seemed to be a tad slower in this one instance. It could use more testing though...it seems like it oughta be faster. One question: It seems that it

Re: [Jruby-devel] ObjectSpace, again.

2006-06-07 Thread Charles O Nutter
This looks like a clever implementation. I'll try to wire it in and see what sort of numbers I get on my microbenchmarks. On 6/6/06, Chris Nokleberg < [EMAIL PROTECTED]> wrote:I've attached a lightly-tested sample alternative ObjectSpace implementation that you might use for inspiration. It is pure

Re: [Jruby-devel] ObjectSpace, again.

2006-06-07 Thread Nick Sieger
On 6/5/06, Ola Bini <[EMAIL PROTECTED]> wrote: The point of this exercise being that it _should_ be dead fast to createa new WeakReference, and add at the end of an arraylist. If somethingactually wants to iterate over ObjectSpace, this will be slower, since we do both cleanup and hash all the obje

Re: [Jruby-devel] ObjectSpace, again.

2006-06-07 Thread Charles O Nutter
Tom and I already discussed it and agreed to leave it enabled, with a tuning option to turn it off. There's not going to be any way to speed it up, but we'll have to just accept it for general run scenarios. There's still the debug hook option to be explored, but I'm not going to expend anymore tim

Re: [Jruby-devel] ObjectSpace, again.

2006-06-07 Thread Nick Sieger
On 6/5/06, Charles O Nutter <[EMAIL PROTECTED]> wrote: Object Creation Without OS: - instantiate object (cheap) - set RubyClass (cheap if we reference builtin classes directly) - set tainting (cheap) Object Creation With OS: - all of the above plus... - list maintenance (potentially very expensiv

Re: [Jruby-devel] ObjectSpace, again.

2006-06-06 Thread Peter K Chan
: jruby-devel@lists.sourceforge.net Subject: Re: [Jruby-devel] ObjectSpace, again. On Monday 05 June 2006 11:20 am, Charles O Nutter wrote: > I tried a very naive version of this, just to demonstrate the performance > gain. > > First off, if you never call cleanup during add, the size of t

Re: [Jruby-devel] ObjectSpace, again.

2006-06-06 Thread Chris Nokleberg
I've attached a lightly-tested sample alternative ObjectSpace implementation that you might use for inspiration. It is pure-Java (no JRuby stuff) so you'll have to adapt it. The key points are: - A list of arrays of references is used instead of just a list of references. This gives you more co

Re: [Jruby-devel] ObjectSpace, again.

2006-06-06 Thread Thomas E Enebo
On Tue, 06 Jun 2006, David Corbin defenestrated me: > On Monday 05 June 2006 11:20 am, Charles O Nutter wrote: > > > > At this point, my vote goes to OS being disabled by default, with a flag to > > turn it on. > > I'm sorry, but you must be joking. It's an integral part of what Ruby is. > Just

Re: [Jruby-devel] ObjectSpace, again.

2006-06-06 Thread David Corbin
On Monday 05 June 2006 11:20 am, Charles O Nutter wrote: > I tried a very naive version of this, just to demonstrate the performance > gain. > > First off, if you never call cleanup during add, the size of the list will > quickly grow to consume all memory. The objects the weakrefs point at will >

Re: [Jruby-devel] ObjectSpace, again.

2006-06-05 Thread Charles O Nutter
I tried a very naive version of this, just to demonstrate the performance gain. First off, if you never call cleanup during add, the size of the list will quickly grow to consume all memory. The objects the weakrefs point at will be collected, but the weakrefs themselves will not. Some cleanup is

[Jruby-devel] ObjectSpace, again.

2006-06-05 Thread Ola Bini
Hi. The big problem with ObjectSpace seems to be that it punishes even those who aren't using it in the current implementation. If we changed the implementation to something like this: private List references = new ArrayList(); private Set realReferences = null; private ReferenceQueue