[MacRuby] #1142: Array#pack performance while converting array of ASCII values to string
#1142: Array#pack performance while converting array of ASCII values to string ------------------------------------------+--------------------------------- Reporter: justin@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ------------------------------------------+--------------------------------- It takes MacRuby over 1600x longer than CRuby 1.9.2 to convert an array of ASCII characters to a 1MB string using Array#pack. Simular to ticket 1136: https://www.macruby.org/trac/ticket/1136 Using MacRuby r5214 that includes the fix from ticket 1136. test.rb: {{{ require 'benchmark' ary = Array.new(1024*1024,0) ret = Benchmark.measure do ary.pack('C*') end puts ret }}} benchmarks: {{{ ~ > ruby ./test.rb 0.040000 0.000000 0.040000 ( 0.043437) ~ > macruby ./test.rb 87.690000 26.300000 113.990000 ( 69.515317) }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1142> MacRuby <http://macruby.org/>
#1142: Array#pack performance while converting array of ASCII values to string ------------------------------------------+--------------------------------- Reporter: justin@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: ------------------------------------------+--------------------------------- Changes (by lsansonetti@…): * milestone: => MacRuby 1.0 Comment: This needs to be fixed in 1.0. -- Ticket URL: <http://www.macruby.org/trac/ticket/1142#comment:1> MacRuby <http://macruby.org/>
#1142: Array#pack performance while converting array of ASCII values to string ------------------------------------------+--------------------------------- Reporter: justin@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.9 Component: MacRuby | Resolution: fixed Keywords: | ------------------------------------------+--------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: MacRuby 1.0 => MacRuby 0.9 Comment: It was the same problem as #1136. I fixed in r5216 all the cases of Array#pack to pre-allocate the result byte string, except 'w' (BER compressed integer). That one might be harder to fix, and I suspect it's not used a lot. -- Ticket URL: <http://www.macruby.org/trac/ticket/1142#comment:2> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby