Forum: Ruby Performance characteristics of Ruby constructs.

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
7359ed44852399295c6247dd9719b81b?d=identicon&s=25 Ola Bini (Guest)
on 2006-05-23 08:11
(Received via mailing list)

I'm right in the situation where I would like to find out some
performance characteristics for various parts of Ruby, to optimize an
application. Is there any resources available for this?

To make it concrete, let's take two examples.

I've recently written a hybrid state-based, table-driven LL(1) parser,
where I gather productions (in the form of symbols) on a stack, and then
execute these with send(), until a get back the next terminal. This
works really great, but right now I'm wondering how cheap send() is,
compared to using a real table-driven approach.

Next example: there's fairly heave use of Class#=== throughout the
application, and the profiler says I spend much time there. It's a
fairly small class of Class comparisons I'm doing, though, so maybe it
would get me better performance by polluting the global namespace like
class Object
  def __is_directive_token?; false; end
  def __is_sequence_start_token?; false; end
class Token
class DirectiveToken
  def __is_directive_token?; true; end
and just do tok.__is_directive_token? instead of DirectiveToken === tok.

Any thoughts in this? Is there any place to find general information
this, or I'm out in the wild right now?

 Ola Bini
This topic is locked and can not be replied to.