ruby pik 使ってみました。
>gem install pik
いろんなバージョンセットして
次を実行させてみました。
C:\rubyapi>type fib.rb
class Integer
def fib
return self if self < n =" 39" start =" Time.now" res =" n.fib">pik benchmark fib.rb
IronRuby 0.9.2.0 on .NET 2.0.0.0
Rehearsal ------------------------------------------------------------
** benchmarking 'fib.rb'
63245986
36.083586 sec
36.140625 0.187500 36.328125 ( 36.208551)
-------------------------------------------------- total: 36.328125sec
user system total real
** benchmarking 'fib.rb'
63245986
37.177028 sec
37.109375 0.078125 37.187500 ( 37.177028)
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java HotSpot(TM) Client VM 1.6.0_07) [x86-java]
Rehearsal ------------------------------------------------------------
** benchmarking 'fib.rb'
63245986
31.023 sec
31.164000 0.000000 31.164000 ( 31.070000)
-------------------------------------------------- total: 31.164000sec
user system total real
** benchmarking 'fib.rb'
63245986
31.117 sec
31.117000 0.000000 31.117000 ( 31.117000)
ruby 1.8.6 (2009-06-08 patchlevel 369) [i386-mswin32]
Rehearsal ------------------------------------------------------------
** benchmarking 'fib.rb'
63245986
126.79241 sec
126.797000 0.000000 126.797000 (126.792410)
------------------------------------------------- total: 126.797000sec
user system total real
** benchmarking 'fib.rb'
63245986
126.908442 sec
126.906000 0.000000 126.906000 (126.908442)
ruby 1.8.6 (2009-08-04 patchlevel 383) [i386-mingw32]
Rehearsal ------------------------------------------------------------
** benchmarking 'fib.rb'
63245986
89.209614 sec
89.172000 0.000000 89.172000 ( 89.209614)
-------------------------------------------------- total: 89.172000sec
user system total real
** benchmarking 'fib.rb'
63245986
88.897342 sec
88.891000 0.000000 88.891000 ( 88.897342)
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-mswin32]
Rehearsal ------------------------------------------------------------
** benchmarking 'fib.rb'
63245986
125.261 sec
125.172000 0.000000 125.172000 (125.261000)
------------------------------------------------- total: 125.172000sec
user system total real
** benchmarking 'fib.rb'
63245986
127.044 sec
127.000000 0.000000 127.000000 (127.044000)
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]
Rehearsal ------------------------------------------------------------
** benchmarking 'fib.rb'
63245986
16.296458 sec
16.281000 0.000000 16.281000 ( 16.296458)
-------------------------------------------------- total: 16.281000sec
user system total real
** benchmarking 'fib.rb'
63245986
16.515203 sec
16.516000 0.000000 16.516000 ( 16.515203)
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mswin32]
Rehearsal ------------------------------------------------------------
** benchmarking 'fib.rb'
63245986
53.686126 sec
53.687000 0.000000 53.687000 ( 53.701750)
-------------------------------------------------- total: 53.687000sec
user system total real
** benchmarking 'fib.rb'
63245986
53.49863 sec
53.500000 0.000000 53.500000 ( 53.498630)
benchmarking 結果
HP Compaq dc5800 Small Form
Intel(R) Core(TM)2 Duo CPU E7300 @2.66GHz
Microsoft Windows XP Proffessional Version 2002 Service Pack2
IronRuby 0.9.2.0 on .NET 2.0.0.0 36.328125
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69f... 31.164000
ruby 1.8.6 (2009-06-08 patchlevel 369) [i386-mswin32] 126.906000
ruby 1.8.6 (2009-08-04 patchlevel 383) [i386-mingw32] 89.172000
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-mswin32] 127.000000
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32] 16.516000
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mswin32] 53.500000
0 件のコメント:
コメントを投稿