/mobile Handheld Friendly website
x64 Ubuntu : Intel® Q6600® quad-core |
Each table row shows performance measurements for this Ada 2005 GNAT program with a particular command-line input value N.
| N | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| 500,000 | 7.60 | 4.40 | 9,856 | 602 | 17% 72% 73% 7% |
| 5,000,000 | 80.99 | 46.50 | 9,856 | 602 | 41% 41% 40% 39% |
| 50,000,000 | 780.66 | 448.18 | 9,856 | 602 | 47% 35% 33% 47% |
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.
GNAT 4.6
gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
-- The Computer Language Benchmarks Game -- http://benchmarksgame.alioth.debian.org/ -- contributed by Jim Rogers with Ada.Text_Io; use Ada.Text_Io; with Ada.Command_Line; use Ada.Command_Line; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; procedure ThreadRing is protected Flag is procedure Set(Num : Positive); entry Wait(Last : out Positive); private Done : Boolean := False; Id : Positive; end Flag; protected body Flag is procedure Set(Num : Positive) is begin Done := True; Id := Num; end Set; entry Wait(Last : out Positive) when Done is begin Last := Id; end Wait; end Flag; type Node; type Node_Access is access Node; Ring : array(1..503) of Node_Access; task type Node(Id : Positive) is entry Start(Next : Node_Access); entry Put(Item : in Natural); entry Stop; end Node; task body Node is Val : Natural; Next_Node : Node_Access; begin accept Start(Next : Node_Access) do Next_Node := Next; end Start; loop select accept Put(Item : in Natural) do Val := Item; end Put; or accept Stop; exit; end select; if Val > 0 then Val := Val - 1; Next_Node.Put(Val); else Flag.Set(Id); end if; end loop; end Node; Num_Passes : Natural; Last_Node : Positive; begin Num_Passes := Natural'Value(Argument(1)); for I in Ring'range loop Ring(I) := new Node(I); end loop; Ring(Ring'Last).Start(Ring(1)); for I in Ring'First..Ring'Last - 1 loop Ring(I).Start(Ring(I + 1)); end loop; Ring(1).Put(Num_Passes); Flag.Wait(Last_Node); Put(Item => Last_Node, Width => 1); New_Line; for I in Ring'range loop Ring(I).Stop; end loop; end ThreadRing;
Sat, 27 Apr 2013 22:31:55 GMT MAKE: /usr/bin/gnatchop -r -w threadring.gnat splitting threadring.gnat into: threadring.adb /usr/bin/gnatmake -O3 -fomit-frame-pointer -march=native -msse3 -mfpmath=sse -gnatNp -f threadring.adb -o threadring.gnat_run gcc-4.6 -c -O3 -fomit-frame-pointer -march=native -msse3 -mfpmath=sse -gnatNp threadring.adb gnatbind -x threadring.ali gnatlink threadring.ali -O3 -fomit-frame-pointer -march=native -msse3 -mfpmath=sse -o threadring.gnat_run 0.50s to complete and log all make actions COMMAND LINE: ./threadring.gnat_run 50000000 PROGRAM OUTPUT: 292