From: Mike Bethany Date: 2011-07-28T18:40:36+09:00 Subject: Re: Fiber performance in 1.9.2-p290 vs -p180 --90e6ba6e83dee5d17404a91df4f4 Content-Type: text/plain; charset=ISO-8859-1 You should note that it's not running the fibers that's taking so much time; it's the creation of the fibers that's taking most of the time. https://gist.github.com/1111286 ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0] 10000, 1: Rehearsal ------------------------------------ Creation: 7.04735 Execution: 0.739264 7.670000 0.080000 7.750000 ( 7.786814) Creation: 2.846162 Execution: 0.337496 3.110000 0.080000 3.190000 ( 3.183820) Creation: 2.574672 Execution: 0.176939 2.680000 0.070000 2.750000 ( 2.751769) -------------------------- total: 13.690000sec user system total real Creation: 1.767601 Execution: 0.217488 1.910000 0.080000 1.990000 ( 1.985250) Creation: 1.418652 Execution: 0.321165 1.690000 0.050000 1.740000 ( 1.740013) Creation: 1.733864 Execution: 0.372116 2.040000 0.060000 2.100000 ( 2.106124) On Wed, Jul 27, 2011 at 9:11 PM, Lunatic Leo wrote: > 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/. > > --90e6ba6e83dee5d17404a91df4f4--