I wrote a simple Fiber benchmark (based on an earlier one I found).
I ran it one MRI ruby 1.9.2-p180 and -p290. The performance
difference was dramatic. p290 executed the benchmark 25-50
times faster. I didn't plot the scaling factor, cuz I don't know an easy
graph plotting tool.

Does anyone know why there is this dramatic Fiber preformance
difference?


-LLeo

P.S.
The code is attached and on github.com as gist:1108752
https://gist.github.com/1108752

I ran (on a 2011 MBP w/8gb ram)
% rvm use 1.9.2-p180
% ./fiber_ring.rb 1000 1
1000, 1,   0.010000   0.000000   0.010000 (  0.012526)
% ./fiber_ring.rb 10_000 1
10000, 1,   3.490000   0.050000   3.540000 (  3.553194)
% ./fiber_ring.rb 100_000 1
100000, 1, 792.170000   1.370000 793.540000 (792.917801)

and
% rvm use ruby-1.9.2-p290
% ./fiber_ring.rb 1000 1
1000, 1,   0.000000   0.010000   0.010000 (  0.012345)
% ./fiber_ring.rb 10_000 1
10000, 1,   0.210000   0.040000   0.250000 (  0.264341)
% ./fiber_ring.rb 100_000 1
100000, 1,  13.910000   0.640000  14.550000 ( 14.664316)

Attachments:
http://www.ruby-forum.com/attachment/6456/fiber_ring.rb


-- 
Posted via http://www.ruby-forum.com/.