/mobile Handheld Friendly website
x64 Ubuntu : Intel® Q6600® quad-core |
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,000 | 13.08 | 9.41 | 111,684 | 342 | 23% 39% 43% 31% |
| 5,000,000 | 68.72 | 52.69 | 401,376 | 342 | 36% 36% 24% 24% |
| 50,000,000 | 622.56 | 471.23 | 574,068 | 342 | 4% 4% 58% 57% |
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.
jruby 1.7.3 (1.9.3p385) 2013-02-21 dac429b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_11-b21 [linux-amd64]
# 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
Sat, 20 Apr 2013 00:42:07 GMT MAKE: mv threadring.jruby threadring.rb 0.01s to complete and log all make actions COMMAND LINE: /usr/local/src/jruby-1.7.3/bin/jruby -Xcompile.invokedynamic=true -J-server -J-Xmn512m -J-Xms2048m -J-Xmx2048m threadring.rb 50000000 PROGRAM OUTPUT: 292