From: reason67@my-deja.com
Subject: Re: Apex vs GNAT on solaris
Date: 1999/12/07
Date: 1999-12-07T00:00:00+00:00 [thread overview]
Message-ID: <82hjo4$7ro$1@nnrp1.deja.com> (raw)
In-Reply-To: 82hiuj$74o$1@nnrp1.deja.com
> 1.2 15 iterations of 100 delays of duration'small in 100 tasks.
-=-=-=-=-=-=-
with Ada.Calendar;
with Ada.Text_Io;
with Common_Utilities;
procedure Aaaa_1_2_Timing_Test is
package Long_Float_Io is new Ada.Text_Io.Float_Io (Long_Float);
Compiler : constant String := "Apex";
Instances : constant := 15;
Iterations : constant := 100;
Task_Number : constant := 100;
type Time_Stamp_Type is array (0 .. Iterations) of
Ada.Calendar.Time;
task type Time_Context_Switches is
entry Start;
end Time_Context_Switches;
for Time_Context_Switches'Storage_Size use 100000;
type Timer_Array_Type is array (1 .. Task_Number) of
Time_Context_Switches;
Timer : Timer_Array_Type;
task Controller is
entry Finish (Biggest : in Long_Float; Average : in Long_Float);
end Controller;
task body Time_Context_Switches is
Biggest : Long_Float := -1.0;
Average : Long_Float := 0.0;
Length : Long_Float;
Time_Stamp : Time_Stamp_Type;
begin
Forever:
loop
Biggest := -1.0;
Average := 0.0;
select
accept Start;
or
terminate;
end select;
Time_Stamp (0) := Ada.Calendar.Clock;
for Index in 1 .. Iterations loop
delay Duration'Small;
Time_Stamp (Index) := Ada.Calendar.Clock;
end loop;
for Index in 1 .. Iterations loop
Length := Long_Float
(Ada.Calendar."-" (Time_Stamp (Index),
Time_Stamp (Index -
1))) -
Long_Float (Duration'Small);
if Biggest < Length then
Biggest := Length;
end if;
Average := Average + Length;
end loop;
Average := Average / Long_Float (Iterations);
Controller.Finish (Biggest => Biggest, Average =>
Average);
end loop Forever;
end Time_Context_Switches;
task body Controller is
Local_Biggest : Long_Float := -1.0;
Local_Average : Long_Float := 0.0;
Instance_Length : Integer;
begin
Ada.Text_Io.Put_Line ("::: [Aaaa_1_2_Timing_Test]");
Ada.Text_Io.Put_Line
(Compiler & " tasking timing test running " &
Common_Utilities.Strip_Spaces (Integer'Image (Instances)) &
" instances of " &
Common_Utilities.Strip_Spaces (Integer'Image (Iterations)) &
" delays of duration'small, in " &
Common_Utilities.Strip_Spaces (Integer'Image (Task_Number))
&
" tasks");
Instance_Length := Common_Utilities.Strip_Spaces
(Integer'Image (Instances))'Length;
for Counter in 1 .. Instances loop
for Index in 1 .. Task_Number loop
Timer (Index).Start;
end loop;
Local_Biggest := -1.0;
Local_Average := 0.0;
for Index in 1 .. Task_Number loop
accept Finish (Biggest : in Long_Float;
Average : in Long_Float) do
if Biggest > Local_Biggest then
Local_Biggest := Biggest;
end if;
Local_Average := Average + Local_Average;
end Finish;
end loop;
Local_Average := Local_Average / Long_Float (Task_Number);
Ada.Text_Io.Put ("Instance " & Common_Utilities.String_Of
(Number => Counter,
Length =>
Instance_Length,
Show_Leading_Zeros =>
False) &
": Maximum time => ");
Long_Float_Io.Put
(Item => Local_Biggest, Fore => 1, Aft => 4, Exp => 0);
Ada.Text_Io.Put (Ascii.Ht & Ascii.Ht & "Average time => ");
Long_Float_Io.Put
(Item => Local_Average, Fore => 1, Aft => 4, Exp => 0);
Ada.Text_Io.New_Line;
end loop;
Ada.Text_Io.Put_Line ("::: [Aaaa_1_2_Timing_Test has
finished]");
end Controller;
begin
null;
end Aaaa_1_2_Timing_Test;
-=-=-=-=-=-=-=-=-
Apex tasking timing test running 15 instances of 100 delays of
duration'small, in 100 tasks
Instance 1: Maximum time => 0.6406 Average time => 0.0257
Instance 2: Maximum time => 0.4628 Average time => 0.0350
Instance 3: Maximum time => 1.0903 Average time => 0.0335
Instance 4: Maximum time => 0.9894 Average time => 0.0327
Instance 5: Maximum time => 0.6160 Average time => 0.0300
Instance 6: Maximum time => 0.6201 Average time => 0.0421
Instance 7: Maximum time => 0.1503 Average time => 0.0374
Instance 8: Maximum time => 0.3606 Average time => 0.0375
Instance 9: Maximum time => 1.0131 Average time => 0.0277
Instance 10: Maximum time => 0.4931 Average time => 0.0329
Instance 11: Maximum time => 0.0979 Average time => 0.0392
Instance 12: Maximum time => 0.5545 Average time => 0.0359
Instance 13: Maximum time => 0.3654 Average time => 0.0329
Instance 14: Maximum time => 0.3740 Average time => 0.0375
Instance 15: Maximum time => 0.6872 Average time => 0.0385
GNAT tasking timing test running 15 instances of 100 delays of
duration'small, in 100 tasks
Instance 1: Maximum time => 0.0051 Average time => 0.0001
Instance 2: Maximum time => 0.0196 Average time => 0.0002
Instance 3: Maximum time => 0.0061 Average time => 0.0001
Instance 4: Maximum time => 0.0001 Average time => 0.0000
Instance 5: Maximum time => 0.0008 Average time => 0.0000
Instance 6: Maximum time => 0.0002 Average time => 0.0000
Instance 7: Maximum time => 0.0055 Average time => 0.0000
Instance 8: Maximum time => 0.0001 Average time => 0.0000
Instance 9: Maximum time => 0.0006 Average time => 0.0000
Instance 10: Maximum time => 0.0004 Average time => 0.0000
Instance 11: Maximum time => 0.0007 Average time => 0.0000
Instance 12: Maximum time => 0.0008 Average time => 0.0000
Instance 13: Maximum time => 0.0235 Average time => 0.0000
Instance 14: Maximum time => 0.0007 Average time => 0.0000
Instance 15: Maximum time => 0.0190 Average time => 0.0006
Sent via Deja.com http://www.deja.com/
Before you buy.
next prev parent reply other threads:[~1999-12-07 0:00 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-12-07 0:00 Apex vs GNAT on solaris reason67
1999-12-07 0:00 ` Robert Dewar
1999-12-07 0:00 ` reason67
1999-12-08 0:00 ` Robert Dewar
1999-12-08 0:00 ` reason67
1999-12-08 0:00 ` Larry Kilgallen
1999-12-08 0:00 ` Robert Dewar
1999-12-08 0:00 ` Robert A Duff
1999-12-07 0:00 ` Roger Racine
1999-12-07 0:00 ` Samuel T. Harris
1999-12-07 0:00 ` Larry Kilgallen
1999-12-07 0:00 ` David Starner
1999-12-08 0:00 ` Robert Dewar
1999-12-07 0:00 ` Jean-Pierre Rosen
1999-12-08 0:00 ` Robert Dewar
1999-12-08 0:00 ` Robert A Duff
1999-12-08 0:00 ` Roger Racine
1999-12-08 0:00 ` Larry Kilgallen
1999-12-08 0:00 ` Roger Racine
1999-12-08 0:00 ` tmoran
1999-12-08 0:00 ` Larry Kilgallen
1999-12-09 0:00 ` Robert Dewar
1999-12-09 0:00 ` Roger Racine
1999-12-09 0:00 ` Larry Kilgallen
1999-12-10 0:00 ` Robert Dewar
1999-12-09 0:00 ` Mike Silva
1999-12-10 0:00 ` Robert Dewar
1999-12-16 0:00 ` Stefan Skoglund
1999-12-08 0:00 ` Ted Dennison
1999-12-07 0:00 ` reason67
1999-12-07 0:00 ` reason67
1999-12-07 0:00 ` reason67
1999-12-07 0:00 ` Robert Dewar
1999-12-07 0:00 ` reason67
1999-12-08 0:00 ` Robert Dewar
1999-12-08 0:00 ` reason67
1999-12-07 0:00 ` Vladimir Olensky
1999-12-07 0:00 ` Vladimir Olensky
1999-12-09 0:00 ` Geoff Bull
1999-12-09 0:00 ` Vladimir Olensky
1999-12-09 0:00 ` Vladimir Olensky
1999-12-10 0:00 ` Vladimir Olensky
1999-12-07 0:00 ` reason67
1999-12-07 0:00 ` reason67
1999-12-07 0:00 ` Robert Dewar
1999-12-07 0:00 ` reason67
1999-12-07 0:00 ` reason67 [this message]
1999-12-07 0:00 ` reason67
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox