/mobile Handheld Friendly website

 performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
500,0000.488.50266,796273  2% 0% 1% 6%
5,000,0001.469.48268,880273  1% 0% 2% 16%
50,000,00011.0719.08268,880273  0% 0% 0% 59%

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

Erlang R16B (erts-5.10.1) [source] [async-threads:10] [hipe] [kernel-poll:false]

 thread-ring Erlang HiPE program source code

% The Computer Language Benchmarks Game
% http://benchmarksgame.alioth.debian.org/
%%% Contributed by Jiri Isa
%%% optimized run time options by shun shino

-module(threadring).
-export([main/1, roundtrip/2]).

-define(RING, 503).

start(Token) ->
   H = lists:foldl(
      fun(Id, Pid) -> spawn(threadring, roundtrip, [Id, Pid]) end, 
      self(), 
      lists:seq(?RING, 2, -1)),
   H ! Token,
   roundtrip(1, H).

roundtrip(Id, Pid) ->
   receive
      1 ->
         io:fwrite("~b~n", [Id]),
         erlang:halt();
      Token ->
         Pid ! Token - 1,
         roundtrip(Id, Pid)
   end.

main([Arg]) ->
   Token = list_to_integer(Arg),
   start(Token).

 make, command-line, and program output logs

Mon, 04 Mar 2013 23:18:05 GMT

MAKE:
mv threadring.hipe threadring.erl
/usr/local/src/otp_src_R16B_nosmp/bin/erlc +native +"{hipe, [o3]}"  threadring.erl
rm threadring.erl
0.48s to complete and log all make actions

COMMAND LINE:
/usr/local/src/otp_src_R16B_nosmp/bin/erl -smp disable -noshell -run +t 8192 +ec +K true +P 50000000 +hmbs 1 +hms 4 +sss 4 threadring main 50000000

PROGRAM OUTPUT:
292

Revised BSD license

  Home   Conclusions   License   Play