[MacRuby-devel] [MacRuby] #348: macruby is slower than ruby 1.9 for priority queue work

MacRuby ruby-noreply at macosforge.org
Thu Sep 24 18:05:15 PDT 2009


#348: macruby is slower than ruby 1.9 for priority queue work
-------------------------------------+--------------------------------------
 Reporter:  jordan.breeding@…        |       Owner:  lsansonetti@…        
     Type:  defect                   |      Status:  new                  
 Priority:  major                    |   Milestone:  MacRuby 0.5          
Component:  MacRuby                  |    Keywords:                       
-------------------------------------+--------------------------------------
 I was originally trying to debug why a program I have that uses priority
 queues was breaking under MacRuby. I am still in the process of tracking
 that one down (to a reproducible, small test case). In the process however
 I ended up with two different pure ruby priority queues that I was using,
 and one Obj-C based priority queue. To further track down the problem I
 pulled out some of the code into a much smaller example.

 Unfortunately, this actually worked for all three cases reliably and I
 could not reproduce the crash. Fortunately it uncovered some cases where
 ruby 1.9 reliably performs better than MacRuby.

 I do not know if these cases are known or not, but I am including the
 timing information inline here as well as in text files in the zip file I
 am attaching.
 using a small set with pqueue
 {{{
 (; ruby1.9 ./small_queue_test.pqueue > /dev/null; )  11.63s user 0.05s
 system 99% cpu 11.691 total
 (; macruby ./small_queue_test.pqueue > /dev/null; )  16.49s user 1.34s
 system 107% cpu 16.509 total
 }}}

 using a larger set with pqueue
 {{{
 (; ruby1.9 ./small_queue_test.pqueue > /dev/null; )  186.19s user 1.20s
 system 93% cpu 3:21.24 total
 (; macruby ./small_queue_test.pqueue > /dev/null; )  219.19s user 17.70s
 system 105% cpu 3:45.16 total
 }}}

 using a small set with ruby_priority_queue
 {{{
 (; ruby1.9 ./small_queue_test.ruby_priority_queue > /dev/null; )  20.28s
 user 0.10s system 97% cpu 20.899 total
 (; macruby ./small_queue_test.ruby_priority_queue > /dev/null; )  37.43s
 user 2.05s system 107% cpu 36.717 total
 }}}

 using a larger set with ruby_priority_queue
 {{{
 (; ruby1.9 ./small_queue_test.ruby_priority_queue > /dev/null; )  230.49s
 user 0.93s system 99% cpu 3:51.97 total
 (; macruby ./small_queue_test.ruby_priority_queue > /dev/null; )  482.74s
 user 25.98s system 105% cpu 8:00.51 total
 }}}

 In the two files "small_queue_test.pqueue" and
 "small_queue_test.ruby_priority_queue" there is a variable at the top that
 controls the starting level for the nodes, a higher number means a larger
 set.

 The small set was run with a starting node of 9, and the larger set was
 run with a starting node of 10.

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/348>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list