Charles Oliver Nutter wrote:
So, it's time to bring up this question. ObjectSpace makes JRuby so much slower, I think it's time to consider disabling it by default.

For example, here's the fractal benchmark, which generates a text-based mandelbrot:

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

We have also made modifications to allow ObjectSpace.each_object(Class) to work even when ObjectSpace is disabled, by tracking an in-memory graph of classes and subclasses. This allows the most visible use case for ObjectSpace--test/unit--to continue working until we can patch it to not use ObjectSpace.

Attached: a patch to flip -O from disabling to enabling ObjectSpace, with it disabled by default.

- Charlie
Index: src/org/jruby/RubyInstanceConfig.java
===================================================================
--- src/org/jruby/RubyInstanceConfig.java       (revision 4774)
+++ src/org/jruby/RubyInstanceConfig.java       (working copy)
@@ -40,7 +40,7 @@
     private PrintStream output         = System.out;
     private PrintStream error          = System.err;
     private Profile profile            = Profile.DEFAULT;
-    private boolean objectSpaceEnabled = true;
+    private boolean objectSpaceEnabled = false;
     private String currentDirectory;
     private Map environment;
     private String[] argv = {};
Index: src/org/jruby/util/CommandlineParser.java
===================================================================
--- src/org/jruby/util/CommandlineParser.java   (revision 4774)
+++ src/org/jruby/util/CommandlineParser.java   (working copy)
@@ -66,7 +66,7 @@
     private String[] scriptArguments = null;
     private boolean shouldRunInterpreter = true;
 
-    private boolean objectSpaceEnabled = true;
+    private boolean objectSpaceEnabled = false;
     private boolean compilerEnabled = false;
     private boolean yarv = false;
     private boolean rubinius = false;
@@ -137,7 +137,7 @@
                     assumeLoop = true;
                     break;
                 case 'O' :
-                    objectSpaceEnabled = false;
+                    objectSpaceEnabled = true;
                     break;
                 case 'C' :
                     compilerEnabled = true;

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to