performance measurements

Each table row shows performance measurements for this Ruby JRuby program with a particular command-line input value N.

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
500,000Failed  342   

Read the ↓ make, command line, and program output logs to see how this program was run.

Read thread-ring benchmark to see what this program should do.

 notes

jruby 9.0.0.0.pre2 (2.2.2) 2015-04-28 2755ae0 Java HotSpot(TM) Server VM 25.45-b02 on 1.8.0_45-b14 +jit [linux-i386]

 thread-ring Ruby JRuby program source code

# The Computer Language Benchmarks Game
# http://benchmarksgame.alioth.debian.org/
# contributed by Klaus Friedel
#

require "thread"

THREAD_COUNT = 503

class Receiver
  @next
  @mailbox

  def initialize(name)
    @name = name
    @mailbox = Queue.new
  end

  def next=(n)
    @next = n
  end

  def put(msg)
    @mailbox.push(msg)
  end

  def messageloop
    while true
      hopsRemaining = @mailbox.pop
      if(hopsRemaining == 0)
        print @name, "\n"
        exit(0)
      end
      @next.put(hopsRemaining - 1)
    end
  end
end

##########
#  Main  #
##########
receivers = []
for i in 0..THREAD_COUNT-1
  receivers[i] = Receiver.new(i+1)
  if(i > 0)
    receivers[i-1].next = receivers[i]
  end
end
#close the ring
receivers[THREAD_COUNT-1].next = receivers[0]

# start the threads
for i in 0..THREAD_COUNT-1
  Thread.start(i){|k| receivers[k].messageloop}
end

receivers[0].put(ARGV[0].to_i)

sleep

 make, command-line, and program output logs

Tue, 19 May 2015 10:55:16 GMT

MAKE:
mv threadring.jruby threadring.rb
0.01s to complete and log all make actions

COMMAND LINE:
/usr/local/src/jruby-9.0.0.0.pre2/bin/jruby -Xcompile.invokedynamic=true -J-server -J-Xmn512m -J-Xms2048m -J-Xmx2048m threadring.rb 500000

PROGRAM FAILED 


PROGRAM OUTPUT:

Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
ThreadError: unable to create new native thread
       initialize at org/jruby/RubyThread.java:552
            start at org/jruby/RubyThread.java:521
  block in (root) at threadring.rb:54
             each at org/jruby/RubyRange.java:452
            <top> at threadring.rb:53

Revised BSD license

  Home   Conclusions   License   Play