/* Take a measure of REXX clauses-per-second (CIPS) */ /* Mike Cowlishaw (mfc@uk.ibm.com) */ /* 1.0 17 Jan 89 Original version */ /* 2.0 3 Jun 89 Remove attempt to simulate commands */ /* 2.1 7 Oct 89 Remove use of not symbols, and correct commentary */ /* 10 Aug 01 Count now 601, updated address; no other changes */ rexxcps=2.1 /* REXXCPS version */ /* This measure of REXX execution speed is based on an analysis of */ /* the dynamic mix of clauses found in a (subjectively chosen) */ /* collection of REXX programs (including commands, macros, and */ /* personal programs). Approximately 2,500,000 lines of trace */ /* output were analysed, and the program below recreates the */ /* dynamic mix of constructs found in that analysis. */ /* In view of the dramatic differences between systems in their */ /* efficiency of issuing commands, the timed loop does not issue */ /* commands (an 'RC=expression; PARSE' sequence is used instead). */ /* This program therefore measures the performance of a REXX */ /* implementation, exclusive of command execution overhead. */ /* Elapsed (user-perceived) time is used, rather than any form of */ /* virtual time. */ count=601 /* Repetition count */ averaging=5 /* Averaging-over count */ tracevar='Off' /* Trace setting (for development use) */ signal on novalue parse source source 1 system . parse version version say '----- REXXCPS' rexxcps '-- Measuring REXX clauses/second -----' say ' REXX version is:' version say ' System is:' system say ' Averaging:' averaging 'measures of' count 'iterations' /* ----- Calibrate for the empty do-loop (average of 5) ----- */ empty=0 do i=1 to averaging call time 'R' do count; end empty=time('R')+empty end empty=empty/averaging noterm=(system='CMS'); if pos('O',tracevar)=1 then noterm=0 if noterm then do say 'Calibration (empty DO):' empty 'secs (average of' averaging')' say 'Spooling trace NOTERM' 'CP SPOOL CON * START NOTERM'; 'CP CLOSE CON PUR' end /* Now the true timer loop .. average timing again */ full=0 do i=1 to averaging trace value tracevar call time 'R' do count; /* ----- This is first of the 1000 clauses ----- */ flag=0; p0='b' do loop=1 to 14 /* This is the "block" comment in loop */ key1='Key Bee' acompound.key1.loop=substr(1234"5678",6,2) if flag=acompound.key1.loop then say 'Failed1' do j=1.1 to 2.2 by 1.1 /* executed 28 times */ if j>acompound.key1.loop then say 'Failed2' if 17