Sha256: 5884a15354ae0dcbf03adb8e2a3da2e92e488e75c6f20648e82d41a4c0020904
Contents?: true
Size: 514 Bytes
Versions: 63
Compression:
Stored size: 514 Bytes
Contents
require 'benchmark' class TestSubject def test 'OK' end end block = proc do test end TestSubject.__send__(:define_method, :defined_method,&block) TEST_AMOUNT = 1_000_000 Benchmark.bm(15) do |x| x.report('method call') do TEST_AMOUNT.times do test_subject = TestSubject.new test_subject.__send__(:defined_method) end end x.report('instance_exec') do TEST_AMOUNT.times do test_subject = TestSubject.new test_subject.instance_exec(&block) end end end
Version data entries
63 entries across 63 versions & 2 rubygems