Skip to content

Instantly share code, notes, and snippets.

# http://www.6blog.us/2013/02/is-polymorphism-faster-in-ruby/
#
# Testing the speed of polymorphism in Ruby. This program is based on the Wikipedia article:
# http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming
#
# To run: ruby main.rb <number of runs to time (optional)>
# Example: ruby main.rb 5
class Animal
def initialize(name)

Keybase proof

I hereby claim:

  • I am smholloway on github.
  • I am sethholloway (https://keybase.io/sethholloway) on keybase.
  • I have a public key whose fingerprint is 04A6 233C 2F88 9B58 DB83 3332 0AFE B2CB 22AC 895A

To claim this, I am signing this object: