Charles Nutter wrote:
>> If with --server on your system JRuby's still slower than IronRuby,...
> Maybe also worth showing an experimental dynopt flag for JRuby that seem to
> improve performance ....


Sorry for my bad english !!

My test consist to verify that symetric multi-core (SMP) is well use by
the VM. In this aspect, pure performence is not important.
the decrease of duration calculation with the increase off used threads 
is my concern.

(http://programmingzen.com/2010/06/28/the-great-ruby-shootout-windows-edition/ 
show that JRuby is superior to IronRuby...)

For discrimination if the issue is in JRuby side or in JVM side, i run 
same
JRubyCode, but invoke a pure Java traitement :
    (1..nb_threads).map {  Thread.new() { Calc.calc(p1,n1) } }
with

class Calc {
  public static long calc(int a, int b) {
    long res=0;
    for (int i=0;i<a;i++)
      for (int j=0;j<b;j++)
       for (int k=0;k<1000;k++)
       res+=i+j+k;
    return(res);
  }
}

c:\usr\ruby\local>jruby thread_bench2.rb
1.8.7, java, 2010-05-12
1000 iterations by 1 threads  , Duration  = 15404 ms
500 iterations by 2 threads   , Duration  = 8147 ms
333 iterations by 3 threads   , Duration  = 5812 ms
250 iterations by 4 threads   , Duration  = 4690 ms
200 iterations by 5 threads   , Duration  = 4648 ms
166 iterations by 6 threads   , Duration  = 4749 ms
142 iterations by 7 threads   , Duration  = 4371 ms
125 iterations by 8 threads   , Duration  = 4222 ms

So JVM scale right :)
And my intel core i7 has realy 4 core...

Attachments:
http://www.ruby-forum.com/attachment/4829/thread_bench2.rb

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