Hi,

>So mruby is it realy the faster ruby vm ?

In general, no. This case is special, since mruby does not have
Bignums and uses faster (and inaccurate) Floats instead.

							matz.


In message "Re: mruby fastr than ruby 2.0 and jruby ?"
    on Tue, 18 Feb 2014 18:23:42 +0100, Regis d'Aubarede <lists / ruby-forum.com> writes:
|
|hello,
|trying this stupid code,
|=========================
|def a(p,j)
|   i=0
|   while i<1000
|      p+=j*(j-1)*(j-2)*(j-3)*(j-4)*(j-5)*(j-6)*(j-7)*(j-8)*(j-9)
|      i+=1
|   end
|   p
|end
|def b(b)
|  starttime=Time.now if b
|  puts("start") if b
|  p=0
|  j=10
|  while j<10000
|   p=a(p,j)
|   j+=1
|  end
|  endtime=Time.now if b
|  puts("end : p="+p.to_s+ "  "+ (endtime-starttime).to_f.to_s + " secs")
|if b
|end
|b(false)
|b(true)
|
|===============================
|I get this strange result :
|
|>jruby j.rb
|start
|end : p=9041028926052438935146265250228470208000000000  14.0 secs
|
|>ruby j.rb
|start
|end : p=9041028926052438935146265250228470208000000000  26.663525 secs
|
|>mruby j.rb
|start
|end : p=9.04102892605544e+45  2.34413399999999 secs
|
|>jruby -v && ruby -v && mruby -v
|jruby 1.6.0 (ruby 1.8.7 patchlevel 330) (2011-03-15 f3b6154) (Java
|HotSpot(TM) Client VM 1.6.0_31) [Windows 7-x86-java]
|ruby 2.0.0p0 (2013-02-24) [i386-mingw32]
|mruby 1.0.0 (2014-01-10)
|
|
|
|
|So mruby is it realy the faster ruby vm ?
|
|-- 
|Posted via http://www.ruby-forum.com/.