Hallo,
while porting our software from ruby1.6 to ruby1.8, we found some
performance issues.
Especially it seems that compiling ruby1.8 with pthreads enabled
(the way package is made in Debian GNU/Linux) gives poor results.
I wonder if other people have noticed this?
···
==============================================================
TEST: 1000.times { a = []; 4000.times {a << 1} }
ruby1.8 without pthread: 6.679s
ruby1.8 with pthread: 10.576s
ruby1.6: 5.755s
==============================================================
TEST: 1000.times { Array.new(3000).join ':' }
ruby1.8 without pthread: 8.087s
ruby1.8 with pthread: 10.503s
ruby1.6: 7.810s
==============================================================
TEST: 1000.times { s = ''; 2000.times {s << 'hello'} }
ruby1.8 without pthread: 5.030s
ruby1.8 with pthread: 6.807s
ruby1.6: 7.099s
==============================================================
TEST: 1000.times { def a; 'hello'; end; 2000.times { a } }
ruby1.8 without pthread: 5.311s
ruby1.8 with pthread: 8.386s
ruby1.6: 4.116s
==============================================================
TEST: 1000.times { h = {}; 1000.times {|t| h[t] = 'hello' } }
ruby1.8 without pthread: 4.064s
ruby1.8 with pthread: 6.436s
ruby1.6: 3.461s
==============================================================
TEST: 1000.times { 200.times {|t| eval('$test%d = \'hello\'' % t) } }
ruby1.8 without pthread: 6.816s
ruby1.8 with pthread: 8.507s
ruby1.6: 5.630s
==============================================================
TEST: 1000.times { ('X' * 100000).sub(/X/) {|s| s.downcase} }
ruby1.8 without pthread: 7.843s
ruby1.8 with pthread: 7.977s
ruby1.6: 7.405s
Regards,
- --
Martin Povolny