[MacRuby-devel] [MacRuby] #424: performance regression from ruby 1.8 and 1.9

MacRuby ruby-noreply at macosforge.org
Thu Nov 5 17:57:49 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:                       
 I have some code that previously ran incorrectly on MacRuby 0.4, and until
 recently crashed MacRuby trunk. Now that it works I would like to report
 that the performance of it is not as fast as 1.8 or 1.9.

 I know that MacRuby working is a primary consideration and speed only
 comes after that, but as people start looking at speed more and more I
 wanted to get this on the radar.

 This also supersedes #348 which was a smaller also based on this code, but
 was a reduced file since the main code would not run.

 Performance of Ruby 1.8, Ruby 1.9, and MacRuby compared using a faster and
 a slower version of the same basic algorithm:

 35 jordan at thetourist ~/priority_queue_bug > for LOOP in ruby ruby1.9
 macruby; do for LOOP2 in ./search.pqueue ./search_slow.pqueue; do eval
 time "${LOOP}" "${LOOP2}" -m -c a-star input_files/input13_7.txt
 >/dev/null; done; done
 ruby ./search.pqueue -m -c a-star input_files/input13_7.txt  4.51s user
 0.10s system 98% cpu 4.657 total
 ruby ./search_slow.pqueue -m -c a-star input_files/input13_7.txt  9.84s
 user 0.15s system 98% cpu 10.087 total
 ruby1.9 ./search.pqueue -m -c a-star input_files/input13_7.txt  2.74s user
 0.08s system 98% cpu 2.851 total
 ruby1.9 ./search_slow.pqueue -m -c a-star input_files/input13_7.txt  5.80s
 user 0.11s system 99% cpu 5.960 total
 macruby ./search.pqueue -m -c a-star input_files/input13_7.txt  14.30s
 user 0.69s system 171% cpu 8.722 total
 macruby ./search_slow.pqueue -m -c a-star input_files/input13_7.txt
 27.30s user 0.88s system 150% cpu 18.745 total

 performance of various versions of the script specific to MacRuby:

 36 jordan at thetourist ~/priority_queue_bug > for LOOP in *.cocoa; do eval
 time macruby "${LOOP}" -c -m a-star input_files/input13_7.txt >/dev/null;
 macruby search.cocoa -c -m a-star input_files/input13_7.txt  14.38s user
 0.79s system 161% cpu 9.392 total
 macruby search_group_add.cocoa -c -m a-star input_files/input13_7.txt
 13.61s user 0.71s system 171% cpu 8.345 total
 macruby search_group_add_slow.cocoa -c -m a-star input_files/input13_7.txt
 26.97s user 0.92s system 146% cpu 19.027 total
 macruby search_slow.cocoa -c -m a-star input_files/input13_7.txt  27.34s
 user 0.94s system 150% cpu 18.730 total

 MacRuby information:

 37 jordan at thetourist ~/priority_queue_bug > macruby -e 'p MACRUBY_VERSION'
 38 jordan at thetourist ~/priority_queue_bug > macruby -e 'p
 "git commit 19b2d7811662bf636cbcc2fe1ae99afef3243225"

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

More information about the MacRuby-devel mailing list