Skip navigation

Lost password? | Help

over me

over me, over co2

As some of you may have heard

As some of you may have heard, we're considering disabling ObjectSpace.each_object by default in JRuby. Primarily, this is for performance; to support each_object, we have to bend over backwards, maintaining lists of weak references to all objects in the system and periodically cleaning out those lists. Here's some example performance, from a fractal benchmark in the JRuby source:

With ObjectSpace: Ruby Elapsed 45.967000
Without ObjectSpace: Ruby Elapsed 4.280000

What's most frustrating about this is that almost *no* libraries or apps use each_object, and it's a terrible performance hit for us.

The one really visible use of each_object is in test/unit, where the default console-based runner does each_object(Class) to find all subclasses of TestCase. Because this is a heavily-used library (to say the least), I've made modifications to JRuby to always support each_object(Class) by maintaining a bidirectional graph of parent and child classes. So that much wouldn't go away (but I'd prefer an implementation that uses Class#inherited, since it would be cleaner, faster, and deterministic).

So...I'm writing this to see what the general Ruby world thinks of us having ObjectSpace disabled by default, enableable via a command line option (or perhaps through a library? -robjectspace?).

I think more and more of you may want to give JRuby another look over the next few months, so I think we need to involve you in such decisions.

As you are forever remindedclimate-change 2007

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.

December 2009
M T W T F S S
November 2009January 2010
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31