DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: B T

⟦a7bc45078⟧ TextFile

    Length: 2473 (0x9a9)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

-- PERFORMANCE MEASUREMENT : Coding Style Feature
--                           Logical equation vs if test
--                           F000001 and F000002 are a pair

with Remote_Global;
use Remote_Global;
with Iteration;
with Piwg_Io;

procedure F000002 is  -- main procedure to execute

    Cpu_Time : Duration;
    Wall_Time : Duration;
    Check_Times : constant := 100;
    Iteration_Count : Integer;
    Its_Ok : Boolean;
    Flag : Boolean;
    Value : Integer;
--

begin

    Value := 50;
    Flag := True;

    Iteration.Start_Control;  -- dummy to bring in pages on some machines

    delay 0.5;  -- wait for stable enviornment on some machines

    Iteration.Initialize (Iteration_Count);

    loop  -- until stable measurement, ITERATION_COUNT increases each time

--
-- Control loop
--
        Iteration.Start_Control;
        for J in 1 .. Iteration_Count loop
            Global := 0;
            for Inside_Loop in 1 .. Check_Times loop
                Global := Global + A_One;
                Remote;
                Flag := not Flag;
            end loop;
        end loop;
        Iteration.Stop_Control (Global, Check_Times);

        if Flag then -- be sure FLAG computed
            Global := 1;
            Remote;
        end if;

--
-- Test loop
--
        Iteration.Start_Test;
        for J in 1 .. Iteration_Count loop
            Global := 0;
            for Inside_Loop in 1 .. Check_Times loop
                Global := Global + A_One;
                if Value < Global then -- feature being measured
                    Flag := True;
                else
                    Flag := False;
                end if;
--               FLAG := VALUE < GLOBAL ; -- equivalent computation
                Remote;
                Flag := not Flag;
            end loop;
        end loop;
        Iteration.Stop_Test (Global, Check_Times);

        if Flag then -- be sure FLAG computed
            Global := 1;
            Remote;
        end if;

        Iteration.Test_Stable (Iteration_Count, Its_Ok);
        exit when Its_Ok;
    end loop;
--
    Iteration.Feature_Times (Cpu_Time, Wall_Time);

--
-- Printout
--
    Piwg_Io.Piwg_Output ("F000002", "Style", Cpu_Time,
                         Wall_Time, Iteration_Count,
                         " Time to set a boolean flag using an 'if' test",
                         " a local and a global integer are compared ",
                         " compare this test with F000001");

end F000002;