Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
require 'benchmark/ips'
class Foo
define_method("foo") { }
class_eval 'def bar; end'
Benchmark.ips do |x|
foo ="class_eval") { }"define_method") { }
class_eval 6874955.4 (±1.0%) i/s - 34395821 in 5.003561s (cycle=205963)
define_method 6187071.9 (±1.7%) i/s - 30989768 in 5.010413s (cycle=289624)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment