[MacRuby-devel] [MacRuby] #424: performance regression from ruby 1.8 and 1.9
MacRuby
ruby-noreply at macosforge.org
Tue Nov 24 21:41:22 PST 2009
#424: performance regression from ruby 1.8 and 1.9
-------------------------------------+--------------------------------------
Reporter: jordan.breeding@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords:
-------------------------------------+--------------------------------------
Comment(by jordan.breeding@…):
Well, I don't have any new deep insights, I need to run shark or dtrace on
the new version later, but I am updating the archive attached to this bug,
and upon creating a new completely ruby based version of a priority queue
based on my Objective-C version I was able to improve the run times of
everything except for MacRuby.
The old pqueue.rb:
{{{
/usr/bin/ruby ./search.pqueue.old.rb -c -m a-star
input_files/input13_1.txt 19.01s user 0.21s system 99% cpu 19.338 total
/opt/homebrew/bin/ruby ./search.pqueue.old.rb -c -m a-star 13.60s user
0.15s system 99% cpu 13.779 total
macruby ./search.pqueue.old.rb -c -m a-star input_files/input13_1.txt
33.11s user 1.53s system 179% cpu 19.251 total
}}}
The new pqueue.rb:
{{{
/usr/bin/ruby ./search.pqueue.rb -c -m a-star input_files/input13_1.txt
9.92s user 0.17s system 99% cpu 10.151 total
/opt/homebrew/bin/ruby ./search.pqueue.rb -c -m a-star 6.38s user 0.12s
system 99% cpu 6.552 total
macruby ./search.pqueue.rb -c -m a-star input_files/input13_1.txt 32.25s
user 1.11s system 142% cpu 23.348 total
}}}
For comparison, the Objective-C based version:
{{{
macruby ./search.cocoa.rb -c -m a-star input_files/input13_1.txt >
/dev/null 28.56s user 1.45s system 179% cpu 16.679 total
}}}
I don't think it is JIT overhead since a small sample still runs quickly
in macruby, I was going to try AOT but the file from macrubyc gives me
errors.
Small sample:
{{{
macruby ./search.cocoa.rb -c -m a-star input_files/input3.txt > /dev/null
1.00s user 0.08s system 107% cpu 1.002 total
macruby ./search.cocoa.rb -c -m a-star input_files/input7.txt > /dev/null
1.03s user 0.08s system 107% cpu 1.027 total
}}}
error with compile:
{{{
286 jordan at thetourist ~/priority_queue_bug > macrubyc -o search.cocoa
search.cocoa.rb
287 jordan at thetourist ~/priority_queue_bug > ./search.cocoa
core:in `dirname:': can't convert false into String (TypeError)
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/424#comment:10>
MacRuby <http://macruby.org/>
More information about the MacRuby-devel
mailing list