Hi all,
I'm developing a code assistance package for Emacs
(
http://github.com/dgutov/robe), and I'd like to provide better support
for Rubinius.
It already works, but it's considerably slower than MRI because I'm
using ObjectSpace.each_object there, for any operation. It's quite fast
on MRI, so it seemed appropriate.
Is there a faster way to do the following things on Rubinius?
1) Enumerate all modules (or all classes) loaded in the current
environment.
2) Enumerate all descendants of a given class. I've looked at
ActiveSupport::DescendantsTracker, and it kinda works, but ideally I
would like to be able to enumerate even the core classes, that are
loaded during IRB startup. It doesn't seem to help with that.
Even JRuby, with ObjectSpace "disabled" by default, runs the following
successfully and within 1 ms:
ObjectSpace.each_object(Module) {|m|}
It takes ~80ms on Rubinius on my machine.
Best regards,
Dmitry