[MacRuby] #1333: #method_missing based metaprogramming is crazy slow compared to CRuby
#1333: #method_missing based metaprogramming is crazy slow compared to CRuby ------------------------------------+--------------------------------------- Reporter: mrada@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ------------------------------------+--------------------------------------- Benchmarks are showing about 30-40x slower for me: {{{ require 'rubygems' gem 'minitest', '>= 2.2' require 'minitest/autorun' require 'minitest/benchmark' class BenchMethodMissing < MiniTest::Unit::TestCase def self.bench_range bench_exp 10_000, 1_000_000 end def method_missing method, *args self end def bench_method_missing assert_performance_linear do |n| n.times do self.lol end end end end }}} Results on MacRuby: {{{ BenchMethodMissing 10000 100000 1000000 bench_method_missing 0.146018 1.524551 20.248081 Finished benchmarks in 22.144926s, 0.0452 tests/s, 0.0452 assertions/s. }}} Results on CRuby: {{{ BenchMethodMissing 10000 100000 1000000 bench_method_missing 0.002976 0.035175 0.468302 Finished benchmarks in 0.529412s, 1.8889 tests/s, 1.8889 assertions/s. }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1333> MacRuby <http://macruby.org/>
#1333: #method_missing based metaprogramming is crazy slow compared to CRuby ------------------------------------+--------------------------------------- Reporter: mrada@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ------------------------------------+--------------------------------------- Comment(by lsansonetti@…): It's because we do a lot of shitload of things before marking a dispatch call as #method_missing. We should probably cache it. -- Ticket URL: <http://www.macruby.org/trac/ticket/1333#comment:1> MacRuby <http://macruby.org/>
#1333: #method_missing based metaprogramming is crazy slow compared to CRuby ------------------------------------+--------------------------------------- Reporter: mrada@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ------------------------------------+--------------------------------------- Comment(by lsansonetti@…): Should be a bit faster with https://github.com/MacRuby/MacRuby/commit/4285742fe5104c9752c4039ce2d49a6441..., but not good enough yet. -- Ticket URL: <http://www.macruby.org/trac/ticket/1333#comment:2> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby