[MacRuby] #1136: Array#pack performance w/ base64 strings

MacRuby ruby-noreply at macosforge.org
Fri Jan 28 11:09:42 PST 2011


#1136: Array#pack performance w/ base64 strings
------------------------------------------+---------------------------------
 Reporter:  justin@…                      |       Owner:  lsansonetti@…        
     Type:  defect                        |      Status:  new                  
 Priority:  major                         |   Milestone:  MacRuby 0.9          
Component:  MacRuby                       |    Keywords:                       
------------------------------------------+---------------------------------
 It takes MacRuby over 13,000x longer to convert a 1MB string to Base64
 than it does CRuby.

 Using MacRuby r5204 and CRuby 1.9.2.

 test.rb:
 {{{
 require 'benchmark'
 str = "0" * 1024 * 1024 # 1MB string data
 ret = Benchmark.measure do
   [str].pack("m")
 end
 puts ret
 }}}

 benchmarks:
 {{{
 ~ > ruby ./test.rb
   0.000000   0.010000   0.010000 (  0.006028)
 ~ > macruby ./test.rb
  81.530000  25.220000 106.750000 ( 81.303252)
 }}}

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



More information about the macruby-tickets mailing list