Basic statement times for ALGOL 60 B A Wichmann, National Physical Laboratory, Teddington, Middlesex November 1973 Abstract This report contains working details of a method of evaluating the processing speed of an ALGOL system using the times of execution for basic statements. Notes on all the times obtained to date (10/10/73) are also included. A more detailed analysis has been added since the production of a similar report (NAC15). Contents 1 Introduction 3 2 Times obtained 2.1 ATLAS . . . . . . . . . . . . . . . 2.2 1904A XALT MkS (summary only) 2.3 1906A XALT Mk5 . . . . . . . . . 2.4 1903A XALT Mk5 (summary only) 2.5 ALGOL 60/RRE (summary only) 2.6 RRE ALGOL 68 . . . . . . . . . . 2.7 B5500 . . . . . . . . . . . . . . . . 2.8 B6500 (summary only) . . . . . . . 2.9 B6700 . . . . . . . . . . . . . . . . 2.10 X8 ALGOL . . . . . . . . . . . . . 2.11 X8 Eindhoven . . . . . . . . . . . . 2.12 KDF9-Whetstone . . . . . . . . . . 2.13 KDF9-Egdon . . . . . . . . . . . . 2.14 KDF9-Mk2 . . . . . . . . . . . . . 2.15 KDF9, Babel . . . . . . . . . . . . 2.16 CDC 6600 version 2.0 . . . . . . . 2.17 CDC 6400 version 2.0 . . . . . . . 2.18 CDC 7600 version 3.0 . . . . . . . 2.19 CDC 6600-Pascal . . . . . . . . . . 2.20 Sigma 9 . . . . . . . . . . . . . . . 2.21 Sigma 6 . . . . . . . . . . . . . . . 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3 4 4 5 5 5 6 6 7 7 7 8 8 9 9 10 10 10 11 11 12 2.22 2.23 2.24 2.25 2.26 2.27 2.28 2.29 2.30 2.31 2.32 2.33 2.34 2.35 2.36 2.37 2.38 2.39 2.40 2.41 2.42 2.43 2.44 2.45 2.46 2.47 2.48 ODRA 1204 . . . . . . . . . . . . ICL 4/S0 (summary only) . . . . ICL 4/70 . . . . . . . . . . . . . ALGOL W 4/75 . . . . . . . . . ALGOL W 360/67 . . . . . . . . IBM 360/65 (summary only) . . IBM 360/65 . . . . . . . . . . . . 360/65,Delft . . . . . . . . . . . . 360/65, Double (summary only) . 360/65, LCS (summary only) . . 360/50, Single (summary only) . 360/50, Double (summary only) . 370/155, Single (summary only) . 370/155, Double (summary only) IBM 370/165 . . . . . . . . . . . ALCOR 7094/1 . . . . . . . . . . TR4 . . . . . . . . . . . . . . . . NU 1108 . . . . . . . . . . . . . . PDP10 . . . . . . . . . . . . . . . H 6050 . . . . . . . . . . . . . . . H6030 (summary only) . . . . . . GE 635 (summary only) . . . . . Simula, CDC 3300 . . . . . . . . Simula 1108 . . . . . . . . . . . . CDC 3300, ALGOL . . . . . . . Siemens 4004/55 . . . . . . . . . MU5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 12 13 13 13 13 14 14 14 14 14 15 15 15 15 15 16 16 16 17 17 17 17 18 18 18 18 3 Comments on the technique 19 4 Analysis of the residuals 19 5 Program listing 29 6 Instructions for running the program 37 7 Analysis output 7.1 Statement times . . . . . 7.2 Statement factors . . . . . 7.3 Residuals . . . . . . . . . 7.4 Statement weights . . . . 7.5 Mixes . . . . . . . . . . . 7.6 Summary for all machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 38 45 46 53 54 55 8 Acknowledgements 57 A Notes 60 2 1 Introduction The basic method is described in [1], [2] and [3]. Forty-one statements in ALGOL 60 are taken as a representative set of the facilities of the language. In general, more complex programs can be considered as being composed of such statements, so that an average program should approximate in its processing speed to a mix of these basic statements. Some extensive program statistics have been collected, and from this an average mix has been derived (see [2]). This technique must be used with care, since an optimising compiler could invalidate the technique. It is possible for such compilers to generate machine code which is very context-dependent, for instance, a statement such as x := a[i] could depend upon whether i is a for loop control variable. Care must also be taken in timing the actual statements. These difficulties have been noted in [1], and arise from the fact that the times are only a few microseconds whereas most machines do not allow accurate timing of intervals of less than a second or so. To overcome this, the timing program listed in this report repeats each statement enough times to ensure that the for loop control code does not predominate. This technique makes an additional assumption that the code for a repeated statement is a repeat of the code for the single statement. This should be checked by examination of the code produced by the compiler. Results from several systems which are not true ALGOL 60 are included here. This is thought appropriate as the languages in question contain a subset which is very nearly ALGOL 60. Simple use of these languages could therefore be expected to use the same facilities in much the same proportion. 2 Times obtained Those times not listed in [1] and [2] or which are thought to be of general interest are listed at the end of this report. Further ones of less general interest appear only in the summary. Comments on the statement times are based upon the residuals calculated in the manner described in [1] and [3]. This is a general method of taking ratios between the statement times for pinpointing the relatively good and poor ones. 2.1 ATLAS This is the compiler which is taken as a standard as in previous work. The com piler produces open code for almost everything except gotos. The subroutine used for goto is a general one catering for formal labels, jumps out of blocks, switches, and consequently this is very slow. The general procedure mechanism is used for abs, sign and entier which are also slow. The display is kept in registers, and the extensive instruction set allows procedure calls to be very straightforward. The compiler does virtually no optimisation as is apparent in 3 the step 1 of the for loop. See [4] for further details of this compiler. The times were produced by F.R.A. Hopgood of the ATLAS Chilton Laboratory 2.2 1904A XALT Mk5 (summary only) The times were produced by ICL and are dated November 1971. They are accurate to about one microsecond, but were produced without statement rep etitions. In fact the time for begin real a; end was zero as no code is produced. In these circumstances a time of about half an instruction time is inserted to avoid a singularity in the analysis. This does not affect the mix as the corresponding weight is zero. The statements k := l × m, x := abs(y), x := sign(y)are relatively slow. The first appears to be caused by the hardware multiply instruction and the last two because the standard external procedure calling mechanism is used. The statements which are relatively fast are • k := 1.0 — type conversion done at compile-time • e1[1, 1] := 1 — subscript optimisation • e1[1, 1, 1] := 1 — subscript optimisation • begin real a; end — no code • begin switch s := q; goto s[1]; q : end — simple switches optimised • x := ln(y) — special coding for y=1.0 The optimisation of constant subscripts invalidates the mix figure since it is assumed that the times for these statements are representative of subscripts in general. A reduction should therefore be made to the mix to allow for this, but the amount depends upon the extent to which the optimisation is done. A reduction of about 5 percent would probably cover it. See [4] for further details of the compiler. 2.3 1906A XALT Mk5 The times were produced from ICL and are dated December 1971. Due to problems with instruction look-ahead on the 1906A. the shorter times were repeated with statement repetitions. The total observation error is therefore about 3 percent. The compiler used is exactly the same as that for the 1904A. so it is necessary to comment only on the slight differences. The time for begin real a; end was put at 0.4 microseconds. in line with the increased power of the machine. The standard functions and � are noticeably relatively slower on the 1906A. whereas the open code statements are relatively faster than the 1904A. This is presumably caused by the increased time for jumps with instruction overlap and interleaved store. A similar reduction of about 5 percent should be made due to the subscript optimisation. 4 2.4 1903A XALT Mk5 (summary only) These times were produced by Dr A. J. Brewer of the Hydraulics Research Station, Wallingford. The 1903A computer had the floating point hardware option. Although the same compiler was used as with the 1904A and 1906A. the optimising options were not used. Hence the array accessing code did not take undue advantage of the constant subscripts, so that the resulting mix figure is more realistic. The longer time for the array declaration of 500 elements is thought to be due to an initialisation to assist a post-mortem dump facility. The times are dated May 1972. 2.5 ALGOL 60/RRE (summary only) These figures were obtained by Dr C.T.Sennett of the Royal Radar Establish ment on their machine, a dual-processor 1907. This is slower (using only one processor, of course) than a standard 1907 due to the logic time required to over come problems of clashes in access to the core-store. The times are not very accurate and are included mainly for comparison with the ALGOL 68 compiler on the same machine. The compiler is an earlier version of those for 1904A and 1906A (XALT Mark 10). The times are dated May 1970. Subscript opti misation has been included, and the array has been initialised (probably as a requirement for the post-mortem). 2.6 RRE ALGOL 68 The language in this case is not ALGOL 60, but ALGOL 68R (see [6] and [7]). The comparison is not necessarily a fair one since ALGOL 68R contains many more features. Storage is not assigned at procedure level, so that begin real a; end does produce some executable code. A planned rewrite of the compiler will assign storage at procedure level. The procedure mechanism is simpler than ALGOL 60 since it is never necessary to generate a ‘thunk’ for a parameter (see [8] for an explanation of this). The times were obtained on the same computer as the last set, and are those which apply when garbage collection is not necessary — a reasonable restriction since this is unnecessary in ALGOL 60 (without dynamic own arrays which most systems omit). The switch has been replaced by a case statement, otherwise the coding is straightforward. The procedure calls for abs, sign and entier have been replaced by operators, which allows the generation of more efficient code without violating any redefinition facility. The comparison between the ALGOL 60 and ALGOL 68 times is interesting. The difference in the unweighted figures is barely significant, but there is a 20 percent deviation in favour of ALGOL 68 when the weights are included. Since ICL have improved the XALT compiler, this gap will now have been narrowed to make the difference insignificant. The main advantage gained by ALGOL 68 is on the procedure call, and its main disadvantage is the lack of optimisation of x := 1 (type change) and constant subscripts. ALGOL 68 does have a 5 disadvantage with array access, which demands N multiplications to access an N dimensional array element — at least with formal arrays. This disadvantage does not effect these tests as the arrays are not formal. 2.7 B5500 As is well known, this computer has special hardware to facilitate the execution of ALGOL 60. In fact, there is no assembly language (in the ordinary sense) so ALGOL is used instead. This means that the design aim of the B5500 ALGOL language is to provide effective access to the machine.s facilities rather than provide a strict ALGOL 60 system. Only two registers are available for the top of the stack. This means, from the point of view of core-accessing, that the B5500 does little better than a one-address machine in the evaluation of expressions. The instruction length of only twelve bits means that code is extremely compact, typically half the size of its conventional counterparts. One consequence of the B5500 architecture is that array declaration involves a supervisor call. Although this is very slow, it has a negligible effect on the mix as the corresponding weights are also very small. The statements x := y � 2 and x := y � 3 are optimised by using the bit pattern technique for exponentiation with any integer less than 1024 (see [9] pp 399). As expected, the stack mechanism has a substantial effect on procedure calls which are relatively the fastest where no special coding has been done. A restriction on B5500 ALGOL makes the procedure call mechanism much simpler — namely that variables declared in one procedure cannot be accessed in procedures nested within it. See [4] for further details of this system. The times were produced by Mr. J. Thomas of the Post Office Telecommu nications Headquarters. 2.8 B6500 (summary only) Both these times and those of the B6700 below were obtained on a version of the hardware with 1.2 µs core store and a 5 Megahertz clock rate. The figures were obtained with the assistance of Barclays Bank Ltd. The computer is a natural development of the B5500, containing enhance ments of many of the same non-conventional features segmentation, shareable instruction segments, stack register organisation and a large control program which is itself extensively segmented. The stack mechanism has been extended to incorporate tasking (see [12]) and the level addressing problem has been solved by a hardware implementation of a display. The change to a display has meant that block entry is now relatively much longer and procedure entry slightly longer than the B5500. The B6500/6700 has the same general characteristics as the 5500. Array declarations are time consuming due to the supervisor call. Also x := 1 is faster than x := 1.0 because integers and reals differ only slightly in the machine, and that in the first case a short literal instruction can be used. Some of the floating 6 point operations and particularly the standard functions are slower than might be expected. This means that the machines could be expected to be relatively faster doing commercial work which is often programmed in ALGOL on these machines. 2.9 B6700 The figures were produced with the assistance of Barclays Bank Ltd. The compiler is identical with the B6500 one; the results are dated May 1971. 2.10 X8 ALGOL The figures were produced by Mr. J. Nederkoom of the Stichting Reactor Cen trum, Holland, in conjunction with Mr. Brinkhuyzen of the Mathematical Cen tre, Amsterdam. The computer is the Electrologica X8, a successor to the X1 computer which was used by Dijkstra in writing one of the first ALGOL compil ers. The computer has a number of facilities to allow convenient implementation of certain features of ALGOL viz: 1. Fast instructions to allow detection of real or integer type. 2. Display handling instructions. 3. An instruction to allow efficient implementation of call-by-name. The original compiler was produced by the Mathematical Centre, Amster dam, but several installations have made local modifications, since the system is well documented. The Reactor Centre version contains substantial improve ments in the array accessing method, which previously checked dynamically the type, dimension, round-to-integer and subscript value. This version usu ally does subscript bound checking only on an assignment. Unfortunately, the basic statements have the subscripts more frequently on the left hand side of an assignment which is not typical in practice. Hence the mix value is slightly pessimistic. The figures are dated October 1971, and were measured with state ment repetitions, but accurate timing appears to be difficult on this machine, so the results have a possible error of up to 10 per cent. 2.11 X8 Eindhoven Although this is the same machine as the last one, it has a completely different compiler designed to work under the T.H.E. operating system (see [11] and [12]). The main difference from the point of view of processing speed is that a virtual memory system has been implemented by software, which means that various operations could invoke a substantial overhead. It is not at all obvious how this overhead ought to be spread over the statement times, so that the mix figure obtained should be treated with extreme caution. A further difficulty is caused by the fact that short arrays are handled differently from long ones. 7 Short arrays are placed upon the stack, whereas long ones are placed off the stack as in the B5500. This means that in order to assess the speed of this compiler properly one would have to know the extent to which the short option would be used. On the basis of the mix figures, the Eindhoven compiler is about ten per cent slower than the original Mathematical Centre compiler, but it is about 40 percent slower than the Reactor Centre version. Against this must be weighed the usefulness of having a virtual memory system where the programmers do not need to be so conscious of the addressing limitations of the machine. The times were obtained by Dr C. Bron of Eindhoven, who also had similar difficulty obtaining accurate figures even with statement repetitions. Owing to the virtual memory difficulties as well, the total errors could be as high as 20 percent. 2.12 KDF9-Whetstone This system is not strictly comparable with the others because of its interpretive nature. It has been included because a sufficient number of systems are now available to make its effect on the analysis of the other systems minimal (this occurs thorough slight changes in the machine and statement factors, but does not alter the mix figure). Interpretation is slow on KDF9 mainly because part word addressing is awkward and it is not possible to exploit the register stack. Hence the residuals show considerable variation; 14 of the simpler statements have a residual of greater than two and 13 of the complex statements have values less than a half. The variation in performance is artificially low since this estimate is based upon one million Whetstone interpretive instructions, rather than a machine independent measure of work. 2.13 KDF9-Egdon This compiler was produced at a very much later date than the KDF9 Kids grove compiler, and was designed for the Egdon operating system. Although it was produced very quickly it relies on some of the experience gained with the Kidsgrove compiler. No optimisation in the global sense has been done al though subscript handling is better and step 1 is treated specially. The local optimisation that is performed produces substantial more compact code than the Kidsgrove compiler. The standard functions are treated specially; abs, sign and entier are coded in-line whereas the rest use the external calling mechanism based on FORTRAN). This is quicker than the ordinary procedure calling mechanism which is used for p0, p1(x), p2(x, y) and p2(x, y, z). Unfortunately about half the weight assigned to p0etc. is for input-output procedures which are called by this external mechanism. Consequently the mix figure may be rather pessimistic. The timing was done by Dr M.D. Poole at Culham Laboratory UKAEA, but the shorter statements were timed by execution of a number of copies of the 8 machine code sequences as described in [1]. The figures are accurate to about 3 per cent. 2.14 KDF9-Mk2 This compiler is a version of the Kidsgrove compiler incorporating a number of enhancements made by the author. The major changes made, with the approx imate increase in speed, are One dimensional array access Two dimensional array access Type conversion of integers Overflow checking (now optional) �2 and �3 by open code 4.5 per cent 3.5 5.7 2.2 2.0 The total improvement is about 20 per cent in the speed of processing ALGOL, but as many programs on KDF9 spend some time executing machine code routines such as input-output) the net saving is about 10 per cent. These changes bring the compiler up to the speed of Egdon. The times are accurate to about 3 per cent. The changes were made by a method of local or window optimisation, full details of which can be obtained from the author. 2.15 KDF9, Babel This language is not ALGOL 60, but contains almost all of the features of ALGOL 60 and many of the extensions included in ALGOL W. Babel is described in [13] and [22]. Naturally, most of the simple statements generate code which is identical to that of the two other KDF9 compilers. In a similar manner to other ALGOL-like languages, a few changes are necessary to some of the state ments. The switch becomes a case statement, abs, sign and entier are replaced by operators and � real uses ln and exp explicitly. Array access is always with subscript bound checking and on KOF9 this is necessarily slow. The goto is very slow indeed because the syntax of Babel demands that the labels placed directly within block. Hence, the actual time measured includes the block entry and exit time (1.4 milliseconds) as well as the actual goto, (.5 milliseconds). Since Babel has a richer set of control structures the ALGOL, an explicit goto should be less common which means that the mix figure is pessimistic. Procedure and block entry times are also slow in Babel. This is mainly due to the generality of the storage allocation system which is designed to sup port several extensions. It would be possible to reduce these overheads if some forms of extensions were precluded. The standard functions and input-output procedures do not use the general mechanism. The times are dated May 1970 and are accurate to about 3 per cent. 9 2.16 CDC 6600 version 2.0 The first version of this compiler (1.0) was less than half as fast as this one, as can be seen from reference [17]. The times were obtained with statement repetitions by J. Wielgosz of the University of London Computer Centre. They appear to be accurate to a few per cent, although figures that are about 20 per cent faster have been sent to the author by Mr. Brinkhuijsen from Amsterdam. However these faster times did not use statement repetitions and so are almost certainly less accurate, especially in view of the timing problems on the 6600. The times for procedure calls are relatively long which is apparently due to two reasons. Firstly the code is in segments, and inter-segment communication is via a slow subroutine which is always used for procedure calls (and gotos which are also slow). Secondly the formal actual correspondence of parameters is checked at run-time which is a substantial penalty. The dummy block is also quite time consuming due to the allocation of storage at block level. This is unfortunate since more registers are used for storage allocation than would be necessary if allocation were done at procedure level. (Allocation of registers is particularly important on this machine as fast times depend on good use of the registers). The for loop control code is poor (with step 1), as is the standard function entier. Excellent optimisation is performed on �2 and �3. Also array access with constant subscripts or subscripts involving only a control loop variable are opti mised. This is necessary because lack of integer multiply requires integers to be represented as floating point numbers. The generation of the code into segments does not appear to be necessary but is presumably demanded by the structure of the compiler. The compiler obviously has great difficulty in making good use of the autonomous registers. Also, as the variable length instructions cannot straddle word boundaries it means that dummy instructions must be generated. In one program they accounted for 22 per cent of the generated code, and many appeared to be unnecessary. 2.17 CDC 6400 version 2.0 The identical compiler to the one above was also timed by J. Wielgosz. The pro cessor is compatible, but the registers are less autonomous. Since the ALGOL compiler does not make good use of this facility, ALGOL is relatively faster than FORTRAN on this machine. In fact FORTRAN programs run about 3 times faster in the 6600, but ALGOL ones are only about 2.2 times faster. 2.18 CDC 7600 version 3.0 This machine, and its compiler appear to be very similar to those of the 6600 and 6400 above. The times were obtained by Mr M Osborne of the Central Computer Agency on the machine at Manchester University. Two runs were made with the timing program; the fast options are listed here; those using diagnostic options (including bound checking) are listed in the summary only. 10 It is not clear whether such a simple technique as the use of basic statements can measure the speed of a fast, complex machine adequately. The author does not have sufficient knowledge of the machine’s architecture to know if the timing loops themselves will run slower or faster than more typical instruction sequences. 2.19 CDC 6600-Pascal This language is defined in [20], and a compiler has been produced by Profes sor Wirth for the 6600. Unlike ALGOL W and ALGOL 68 Pascal does not contain quite all the features of ALGOL 60. In Pascal, arrays are allocated a fixed amount of storage in the same manner as simple variables (or arrays in FORTRAN). This is a deliberate design decision in order to allow a compiler to produce code comparable with assembly-coding. This implies that the ar ray accessing statements with constant subscripts can (and are) compiled in an identical manner to simple variable access. There is also no equivalent of the array declaration in ALGOL 60. Professor Wirth has provided theoretical times (ie deduced from the machine timing manual) for most of the simpler statements. Some statement-to-statement optimisation is performed so that it would not be possible to run the program in this report as it stands. A few additional statement times can be reliably estimated from the theoretical fig ures, while the standard function times were taken from those for ALGOL 60. The block entry statements (including the array declarations) were estimated by the analysis program. The resulting mix figure is about three times that for ALGOL 60 on the 6600. Some small test programs written for both systems give a speed improvement of between 4 and 50. These improvements have been made by the following changes: • simpler and more direct input-output system • representation of integers as fixed point quantities • fast procedure call mechanism • less dynamic assignment of array storage. It is interesting to note that procedure calls are relatively faster in Pascal on the 6600 than in ALGOL on the B6700, in spite of the hardware assistance given on the Burroughs machine. Similar times for Pascal on the 6400 are given in the summary. 2.20 Sigma 9 These statements times were produced using the program in this report and are dated December 1972. Subscript checking was suppressed although it is ordinarily performed in a time-sharing environment. The two type conversion statements x := 1 and k := 1.0 were relatively fast, presumably because of conversion by the compiler, whereas l := y was slow. The statements x := y � 11 2 and x := y � 3 were slow. A significant degradation of performance occurs with the procedure calls, although the standard functions are fast (particularly abs and sqrt). The block entry mechanism is slow, as is the declaration of a large array which involves a supervisor call to claim an extra page of core. 2.21 Sigma 6 This machine is compatible with the Sigma 9, and the same compiler was used. The residuals show the same pattern, so that the machine can be characterised as being about 55 per cent of the speed of the Sigma 9. 2.22 ODRA 1204 This is a Polish computer which has been timed by Mr J Roman of Bydgoszcz, Poland. Apparently the machine is logically similar to the ICL 1900 range, although the instruction times are longer (20 microseconds fixed point, 40 float ing). The statements which have been handled relatively quickly are all those involving blocks, , k:=l+m and the loop control code. The slow ones are x := 1, x := y/z, x := l, x := y � 2, x := y � 3, and the array accessing statements (presumably owing to subscript checking). The figures are dated November 1972 and used the compiler release 3 pro duced in Wroclaw. 2.23 ICL 4/S0 (summary only) This is the first of a series of times produced on machines with the IBM 360 instruction set. Because of this similarity many interesting comparisons can be made. These times were produced by Mr. P.H. Leng of ICL (now at Liverpool University). They were timed as accurately as the machine permits (about 2 per cent error), and were checked against the machine specification. The times are dated October 1970. Integer to real type conversion is slow as can be seen from x := l. This would make it worth while to optimise x := 1. Storage is allocated at procedure level, but a few instructions are generated for block exit because of the possibility of array declarations within the block. Internal procedure calls are handled well in the same manner as KDF9, Atlas and ALGOL 68R, that is by stacking each value parameter in the position where it is required in the called procedure. A major weaknesses the time taken to call external procedures including the standard functions. This is particularly noticeable with abs, sign and en tier which could probably be managed with open code. The author has been informed that it is caused by preserving and restoring the complete set of reg isters on external procedure calls. This seems unnecessary. 12 2.24 ICL 4/70 This compiler is the same as that for the 4/50. The values of the residuals have the same pattern as those for the 4/50, so little more need be said. The statements were timed with repetitions, taking substantial care to get figures consistent to five percent and agreeing with the machine specification manual. They were produced by the Post Office Telecommunications Head quarters. 2.25 ALGOL W 4/75 This computer is essentially identical to the 4/70, but the compiler for ALGOL W (see [14] and [15]) was implemented at Stanford University. The compiler was dated November 1969, and the timing was undertaken in January 1971 by Mr. I. Parsons of Bristol University. Statement repetitions were used but variations of the order of ten percent were observed on reruns. ALGOL W appears to be nearly twice as fast as ALGOL 60 on this ma chine. One important difference is that ALGOL 60 uses 64 bit reals, whereas 32-bit reals are used in ALGOL W. Some of the shorter statements are obvi ously similar if not actually identical, but all the more complex processes are substantially faster with ALGOL W. This applies very much to the standard functions, but since abs and entier are implemented by operators these are not strictly comparable. 2.26 ALGOL W 360/67 This computer is essentially a 360/65 with a paging option. The times were produced by Professor Satterthwaite at Newcastle University and are dated June 1972. Several improvements have been made to the compiler over the last three years, some as a result of an analysis of the basic statement times. The compiler is version 3 which is later than that used on the 4/75, and contains a powerful debugging system(see [19]). Times for the same compiler when the processor is run as a standard 360/65 appears in the summary. The address translation (required for paging) slows the processor of the 360/67 down by about 20 per cent. The type conversion statements k := 1.0, x := l and l := y are slow as are x := y � z, block entry and entier. It is clear that this release of the compiler has improved the statements x := 1 and x := y � 3. 2.27 IBM 360/65 (summary only) These times are for the IBM level F compiler for ALGOL 60. They were obtained by Professor Samet at University College London, and are dated January 1969. Improvements have certainly been made by users to the compiler since these figures were produced. It is easy to see that the main defect is the slow times for entry to a block or procedure, apparently caused by using a supervisor call to claim and return core store for the stack. 13 The 32-bit real arithmetic option has been used which means that the figures are comparable with those of ALGOL W. However, statement repetitions were not used, and it is not thought that the times are very accurate. Apart from the block entry difficulty, the other major difference from ALGOL W is that this compiler optimises array subscripts. As noted before, this means that the assumption upon which the mix was based is not valid. One can attempt to make an allowance for this by reducing the mix figure by about 5 percent. 2.28 IBM 360/65 These times are from Dr J. W. van Wingen of Leiden, Holland. The compiler used is level F, but the improvement package offered as a type 3 release by IBM has been applied. This removes the GETMAIN on block and procedure entries, as well as improving the optimisation of array accessing. In this case 32-bit arithmetic was used, no subscript checking was performed, and an average of four measurements were made to improve accuracy. These figures are therefore comparable with those of ALGOL W, although the mix figure is a third of that of ALGOL W (even though more facilities are provided in ALGOL W). 2.29 360/65,Delft A new ALGOL 60 compiler has been written for the 360 at Delft University, Holland. Provisional statement times are reproduced here, but additional di agnostic code has been included (such as subscript checking), so the figures cannot be fairly compared with the others in this report. However the block entry times are much faster and the procedure calls are no slower than those with the improvement package. The times were from Dr Wingen, using 64-bit reals and are dated May 1972. 2.30 360/65, Double (summary only) These times are from Dr Wingen using 64-bit reals, but including the improve ment package. An average of five timings has been used. 2.31 360/65, LCS (summary only) These times are from Delft University using the standard F compiler with sub script checking. It is not known whether 32 or 64 bit reals were used. 2.32 360/50, Single (summary only) These times are from the Technische Hogeschool, Twente, Holland. The stan dard. compiler was used with 32-bit reals, and the times are dated September 1969. 14 2.33 360/50, Double (summary only) These times are from the Technische Hogeschool, Twente, Holland. The stan dard compiler was used with 64-bit reals, and the times are dated September 1969. 2.34 370/155, Single (summary only) These times are from Dr J. W. van Wingen and were run at Nijmegen University, Holland. They were produced using the standard compiler with 32-bit reals and bound checking. 2.35 370/155, Double (summary only) These times are from Dr J. W. van Wingen and were run at Nijmegen University, Holland. They were produced using the standard compiler with 64-bit reals and bound checking. 2.36 IBM 370/165 Times for this machine were received from Mr. R. Brinkhuijsen of the Mathma tisch Centrum, Amsterdam. The program used did not repeat the statements, so it is thought that the times may not be particularly accurate, although the loop code was timed several different ways to avoid consistent errors due to this. The figure mix obtained must be regarded with extreme caution because of the cache store. The program loops which do the timing are very small so that all accesses are likely to remain in the cache store. Hence the times obtained are likely to be on the low side because the hit rate on the cache store is higher than would be usual with most programs. To overcome this defect would be necessary to know what hit rate is to be expected from average scientific programs in ALGOL and then repeat the statements so as to achieve this. For instance, instead of writing x := y, one might write x := y, n := v, w := u; etc. each statement being of the same form but using different variables to fill the cache store. The basic statements overweight the store operation which is relatively slow on the 165 because stores are always performed on the main store as well as the cache. The reliability of these measurements is therefore rather low. 2.37 ALCOR 7094/1 This compiler is described in [16]. It was one of the first ALGOL compilers to do extensive for loop optimisation. As with the other compilers this really invalidates the mix figures and so to allow for this, the mix figure should be reduced by about five per cent. Apart from procedure entry, the times are fairly consistent. The functions abs, sign and entier appear to be performed by open code and presumably ln(1.0) has been coded exceptionally. The general proce dure entry mechanism has obviously not been used for the standard functions. 15 Since input/output is FORTRAN-like rather than by procedure calls, the mix figure may be somewhat pessimistic. Parameters are checked at compile time (see [16]), so the reason for the slow procedure call times is not clear. The times were produced by Dr. E. Hansen at NEUCC Copenhagen in October 1969. An additional test showed that programs with heavy array accessing can run three times more quickly with this optimisation than if subscript checking is performed. 2.38 TR4 These times are from Karlsruhe University and are published in [18]. Additional statements were also timed, but since figures are not available for others systems, these have not been included. The system handles the statements k := 1.0, x := l, x := y � 2, x := y � z, begin real a; end, x := sqrt(y) and the procedure calls quickly whereas the array accesses are slow (owing to bound checking?). The array declarations and the function abs are also relatively slow. This compiler was written by the ALCOR group. 2.39 NU 1108 The times were produced by Dr. P.T. Cameron of Univac Ltd., for the compiler written in Trondheim Norway, which now replaces the previous compiler (see [2]). Further tests were also run by Dr. Cameron these are reported in [4]. One very slow time is that for declaring an array of 500 elements. This is caused by initialising the array values to zero. Since this is not a requirement of ALGOL and could lead to difficulties in transferring programs, there does not seem to be a good case for zeroising these elements. Block entry and procedure times are slow. Variables are assigned storage at block rather than procedure level so that block entry will involve some code. The statement x := y � z is fast because when z = 1.0 (an integer value) repeated multiplication is used. The standard function calls are fast and clearly do not use the general procedure entry mechanism. Although procedure calls are slow, the overhead per parameter (at least for value parameters) is very small. Statement repetitions were not used and the figures are thought to be within 10 percent of the correct values. They are dated April 1971. 2.40 PDP10 This compiler is a new one, written by Carnegie Mellon University for the Digital Equipment Corporation. The times were produced using the program listed in this report. The machine was one with a KA10 processor and one microsecond core store. Theoretical times for the shorter statement are about 30 percent faster than the observed times. The observed times are self-consistent to about five percent, so it is clear that the additional overheads (cycle-stealing, monitor interrupts etc.) are fairly uniform. 16 The following interesting points about the times should be noted. Type conversion is slow except where it has been performed at compile time ( x := 1, k := 1.0). The operation x := y � 2 has been optimised but x := y � 3 has not. There is almost certainly some special coding for x := y � z (z = 1.0) and x := ln(y)(y = 1.0). Procedure calls seem to be somewhat slow; this appears to be caused by the handling of parameters. The function sign is slow although abs is fast, an unusual combination. The for loop control code has been optimised, but this may be a consequence of an ALGOL extension which allows the step 1 to be omitted. It is not clear whether optimisation would have been performed if step 1 had been included. The times are dated November 1971. 2.41 H 6050 The Honeywell 6000 series of machines is upward compatible with the GE600 series which it replaces. The times from this machine were produced in October 1972, using the standard compiler without bound checking. The statements k := 1.0, x := y � 2, x := y � 3, block entry and the goto are fast whereas the standard functions sin, cos, abs, sign and entier are slow. It is unusual for sin and cos to be slow since the other functions ln, exp and arctan are often calculated in a similar manner. The functions abs, sign and entier are probably slow because of the procedure overhead. 2.42 H6030 (summary only) This machine is compatible with the 6050; the results have been produced using the same program and so show the same pattern. 2.43 GE 635 (summary only) This machine is also compatible with the 6050, and shows the same pattern of performance. 2.44 Simula, CDC 3300 This language is an extension of ALGOL 60 with additional features for data structuring and simulation work. The times were produced by Mr A Wang of the University of Oslo and are consistent to about one per cent. The fast statements are k := 1.0, x := ln(y) and the goto. The slow ones all involve block entry and are begin real a; end, begin array a[1 : 500]; end, the switch and the procedure calls. The array declaration is slow because all arrays are zeroised on declaration. From the point of view of execution speed, the only significant disadvantage of Simula appears to be an extra penalty of about 240 microseconds on block entry. Since blocks other than those in procedures are not called very frequently, the net effect is that procedure calls in Simula are about three times slower than 17 might be expected with ALGOL 60. The ALGOL 60 compiler for the 3300 is not typical, and requires even longer than Simula for procedure calls. 2.45 Simula 1108 Times for this Simula compiler were produced by Mr T. Boen of the Norwegian Computing Centre Oslo and are dated August 1973. Naturally, the majority of the simpler statements produce the same machine code as the ALGOL 60 compiler for the 1108. The procedure call and block entry times are different, mainly because a more complex storage allocation scheme is necessary with Simula. It is not clear that the overheads involved with this scheme have been correctly added to the basic statement times. If these overheads are avoided, as can happen with simple programs, Simula is about 60 per cent faster than NU 1108 ALGOL. The gains with typical programs are likely to be significant but much smaller. 2.46 CDC 3300, ALGOL The statement times for this machine appeared in reference[18] from Karlsruhe University and are for version 1.0 of the compiler. The time for entier is so excessively long that it is thought to be a typing error, an estimate has therefore been used in this report. The block entry, the goto and procedure calls are very much longer than expected. The overall speed is about 25 per cent less than that of the Simula system, although one would expect the more general facilities of Simula to affect performance adversely (especially procedure calls). 2.47 Siemens 4004/55 These times were produced by Dr W Gitt of Physikalisch Technische Bunde sanstalt, West Germany. In ALGOL 60, 64-bit reals are used which on this processor is very much slower than the 32-bit reals that FORTRAN provides. The times are dated June 1972, and were produced with version 6 of the com piler. The arctan function is very slow indeed, and sin (or cos) are slower than exp and ln for no obvious reason. Type conversion is slow so it is disappointing that the conversion in x := 1 is not handled by the compiler. Integer arithmetic, the array declarations, abs, goto and the loop control code are relatively fast. 2.48 MU5 The times for this computer, an experimental Manchester University machine, appeared in the Computer Journal [23]. The figures have been deduced from the design logic of the machine and hence are provisional and will be replaced by observed times in due course. Some errors in the paper have been corrected, but the mix figure produced is significantly lower than that claimed by Ahmad. 18 The reason for this is that the MU5 is exceptionally fast for array declarations, which have no effect on the mix. 3 Comments on the technique If a compiler produces machine-code which is derived very largely from the syntax and is not context dependent, this technique seems a good one for mea suring performance. It is relatively easy to perform, it pinpoints performance weaknesses, and is reliable. The actual choice of basic statements is not good. The choice was determined by the availability of data on a few rather than by careful selection. The major deficiencies statements are 1. x := y � z (because z = 1.0) 2. x := ln(y) (because y = 1.0) 3. lack of conditional expressions and statements 4. lack of parameter access 5. only constant subscript values with arrays. The difficulty with subscript values is a severe one since they are frequently used and the code generated can depend critically on the context. In order to solve this problem one must have better statistical information on the use of subscripts in particular contexts. Since this is not available from [2] and no other source is known, there is little that can be done at present. A similar approach has been taken by Akka [8] to measure performance. Akka modified the Manchester Atlas Autocode compiler to obtain figures sim ilar to those of the author in [2]. He then constructed a benchmark which exercised each language feature in the same proportion as that observed in 200 or so programs. The time taken to execute the benchmark was taken as the performance measure. This should agree very closely with the ALGOL mix since the only difference is that Akka embeds the mix in the program whereas here it is calculated explicitly. Curnow [2] has constructed a similar benchmark from the statistics used in this report. In his program, the loops have been carefully constructed to avoid undue optimisation by current compilers. Hence the program is more suitable for languages like FORTRAN, for which optimisation is technically easier and has been performed by a number of compilers. 4 Analysis of the residuals The model assumes the statement times are a product of two factors, one de pending on the machine (and compiler) and the other depending on the state ment. This is only an approximation to the truth. Even within one manufac ture’s computer range, processing rate is not a constant proportion independent 19 of the machine instructions used. For instance, the less powerful scientific ma chines often execute fixed point operations relatively more quickly than the corresponding floating point operations. However, these factors are small com pared with the overall instruction rate and the influence of the compiler. Hence the residuals do give a broad characterisation of the machine architecture and the compiler, as can be seen below. The residuals from the 42 statements can be regarded as measurements on the machine/compiler. On the other hand, the 50 or so machines can be re garded as giving information about the characteristics of the statements. These two problems can be subjected to factor analysis, but since the units of mea surement of the residuals are the same (ratios in time), the principle component method was thought to be appropriate. However, the eigenvalues were not suf ficiently different from values expected by chance. The reason for this is that the relationship between the residuals is non-linear. As an example, the times for the procedure calls are roughly • t( p0) = a • t( p1(x)) = b + c • t( p2(x, y)) = b + 2c • t( p2(x, y, z)) = b + 3c where a b and c are constants and a and b are approximately equal. Taking logarithms to exhibit the basic speed difference between the machines then destroys the additive property. The comparatively simple technique of calculating the pairwise correlation coefficients provided the required information. The correlation coefficients of the logarithm of the ratios between the expected and actual times were used. Fifty five machines were subjected to this analysis, calculating the coefficients both in terms of the statements and the machines. A histogram of the distribution of the correlation coefficients is shown in Figure 1 (for statements) and Figure 4 (for machines). It is clear from this. as it is from the relevant statistical tables that coefficients above about 0.6 are significant. As expected, no negative correlations are significant, but several positive correlations are well above the chance level. In both cases, the median correlation coefficient is slightly negative, although there is no explanation for this. The significant correlations can be displayed diagrammatically by represent ing the machines or statements as points in a plane. The coefficient is rep resented by a distance on the scale shown at the base of each figure. With the exception of Figure 7, the significant correlations are shown by joining the corresponding points. Naturally, the diagrams are not an exact representation, since the points are not planar, but the distortion is slight except in the case of Figure 7 where the 10 points are very loosely correlated. The scale used is arccos(coefficient) in an attempt to make the diagram as planar as possible. As expected, the basic statements fall into a number of groups. The most highly correlated are the procedure calls, followed by the array access and array 20 declaration statements. The functions abs, sign and entier can all be handled by open code or can equally be dominated by a procedure linkage overhead. The function sqrt correlates only with exp, while the other statements correlating with exp are probably calculated by a power series. Note that ln is missing because of the special coding when y=1.0. The simple statements are only loosely correlated. Three subsets can be iden tified corresponding roughly to variable access, integer arithmetic and floating point arithmetic. The isolated statements all have features which distinguish them from the others. Integer multiplication is handled unevenly by the hard ware of machines, whereas integer division often requires a subroutine. The statement x := y � z does not always involve exp and ln because when z=1.0 some routines take a short-cut. The type conversion statements depend upon the hardware and vary significantly. One of the most inconsistent statements is the entry and exit to a dummy block. Several systems generate no code at all, some only 2 or 3 instructions whereas others used a supervisor call. Similarly, the software determines the performance of the goto which in hardware terms could hardly involve more than one instruction. Some compilers insert tracing code at a label, while others use a general technique for jumps involving an examination of the stack. The analysis of the machines does not result in such a division into highly correlated groups. Note that the machine and compiler must be regarded as a pair as the software influences the pattern of residuals considerably. The KOF9, Atlas, ALGOL 68 and ALGOL W group are all characterised by a fast procedure mechanism. All except ALGOL W calculate value parameters in a pre-call sequence, and use no or only short subroutines. The correlation between the Whetstone interpretive system and Atlas is somewhat surprising. Both systems perform complex operations relatively quickly, the Whetstone system because of the interpretive overhead and Atlas because of the use of a good register instruction set and no subroutines. Most of the other significant correlations are because the same compiler is involved. The Simula 3300 and NU 1108 compilers were both written in Nor way, so the correlation may be a result of collaboration. The KDF9 Egdon and Mathematical Centre Amsterdam compiler for the X8 have no known connec tion. The IBM compilers on various machines and with some options are illus trated in Figure 7. All except one of the compilers based upon the level F system appear in the diagram. The option of using LCS (Large Core Store, slow but cheaper memory) on a 360/65 makes such a large difference to the statement times and their ratios as to give no significant correlation with the others. This option is hardly a realistic one for processor-bound jobs. 21 histogram -1.00* -0.96* -0.92* -0.88* -0.84* -0.80* -0.76* -0.72* -0.68 * -0.64* -0.60* -0.56 * -0.52 * -0.48 -0.44 -0.40 -0.36 -0.32 -0.28 -0.24 -0.20 -0.16 -0.12 -0.08 -0.04 0.00 0.04 0.08 0.12 0.16 0.20 0.24 0.28 0.32 0.36 0.40 0.44 * 0.48 0.52 * 0.56 * 0.60 * 0.64 * 0.68 * 0.72 * 0.76 * 0.80 * 0.84 * 0.88 * 0.92 * 0.96 * 1.00 * * * * * * * * * * * * * * * * * * * * * * * * * Figure 1: Distribution of statement correlation coefficients 22 array procedure calls l:= e1 access p0 e1 p1 p2 p3 e2 (integer) 2 e3 3 k := 1.0 x := 1 type conversion entier sign abs logical functions sqrt [1:500] array declarations exp mathematical functions [1:1] sin [1:1,1:1] 1.0 cos arctan [1:1,1:1,1:1] 0.9 0.8 correlation coefficient 0.7 0.6 Figure 2: Statement correlations 23 k := l k := 1 k := l + m variable access x := 1.0 x := y integer k := l � m arithmetic k := l � m x := l loop time l := y x := y + z x := y z real a floating point goto arithmetic switch ln x := y/z x := y � z 1.0 0.9 0.8 0.7 0.6 correlation coefficient Figure 3: Statement correlations 24 histogram -1.00* -0.96* -0.92* -0.88* -0.84* -0.80* -0.76 * -0.72 * -0.68 * -0.64 * -0.60 -0.56 -0.52 -0.48 -0.44 -0.40 -0.36 -0.32 -0.28 -0.24 -0.20 -0.16 -0.12 -0.08 -0.04 0.00 0.04 0.08 0.12 0.16 0.20 0.24 0.28 0.32 0.36 0.40 0.44 0.48 0.52 0.56 0.60 * 0.64 * 0.68 * 0.72 * 0.76 * 0.80 * 0.84 * 0.88 * 0.92 * 0.96 * 1.00 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Figure 4: Distribution of machine correlation coefficients 25 ALGOL W 360/65 ICL 503 ALGOL W 360/67 ALGOL 68, Malvern KDF9 Whetstone KDF9, Kidsgrove ALGOL W 4/75 360/65, Delft compiler Atlas PDP10 ALCOR 7094/1 ODRA 1204 KDF9, Kidsgrove, Mk2 TR4 Siemens 4004/55 360/65, F compiler using LCS ICL 1907 obsolete compiler CDC 3600, Norwegian compiler 1.0 0.9 0.8 0.7 0.6 correlation coefficient Figure 5: Machine correlations 26 B6500 ICL 4/70 ICL 4/50 ALGOL 60, RRE KDF9, Egdon B5500 1903A B6700 1906A E1-X8 1904A X8,ALGOL X8,Endhoven Sigma 9 GE635 Sigma 6 H6050 H6030 Babel, KDF9 Nu1108 Simula, CDC3300 CDC 6600 CDC 6600 CDC6500 ICL4130 2 microsecond CDC6400 1.0 0.9 0.8 0.7 0.6 correlation coefficient Figure 6: Machine correlations 27 ICL4130 6 microsecond 370/155, Double, checking 360/50, Double 370/155, checking 360/50 LCS, Double 360/50 360/65, Double, package 360/50 LCS 360/65 360/65 370/165 1.0 0.9 0.8 0.7 0.6 correlation coefficient Figure 7: Machine correlations - the IBM group 28 5 Program listing begin real x, y, z; library a6, a30; comment a6, a30 are the standard functions and input/output routines; integer i, n, k, l, m, case; integer array e1[1 : 1], e2[1 : 1, 1 : 1], e3[1 : 1, 1 : 1, 1 : 1]; procedure p0; ; procedure p1(x); value x; real x; ; procedure p2(x, y); value x, y; real x, y; ; procedure p3(x, y, z); value x, y, z; real x, y, z; ; array t[1 : 43]; procedure outreal(channel, x); value channel, x; integer channel; real x; comment prints x to full accuracy, see CACM Vol7 no10 pages 628-630. KDF9 implementation follows; output(30, x); procedure printt; begin integer i; real x, mix, loop; comment calculate and print time differences; for i := 1 step 1 until 42 do begin tt[i] := x := tt[i +1] - tt[i]; 29 outreal(1, x) end; comment calculate ALGOL mix figure as from CCU11, making allowance for statement repetitions; loop := x; mix := 0.0; i := 1; for x := 1000, 875, 769, 3337, 6242, 2750, 187.5, 125, 430, 995.6, 160.3, 384.6, 500, 166.7, 1390, 154.5, 442, 4759, 5321, 148, 4759, 0, 59, 59, 39, .73, 201, 94, 1020, 1490, 278, 831, 644, 1750, 591, 27.3, 454.5, 788, 2316, 2316, 6053 do begin mix := mix + (tt[i] - loop) × x/n; i := i + 1; end mix := mix + loop × 1780/n; outreal(1, 6524502/mix ) end; real procedure cputime; comment procedure which gives the processor time taken by the program in arbitrary (but known) units, KDF9 implementation follows; KDF9 1/ 1 / 1 / 0; set3 out; set23; float; EXIT; ALGOL; x := y := z := 1.0; l := k := m := 1; e1[1] := 1; case := 1; n := 1000; comment n should be given a large enough value for the resolution of the clock not to be a limiting factor to the accuracy. If n is made too large, then processor time will be wasted; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin x := 1.0; x := 1.0; x := 1.0; x := 1.0; x := 1.0; x := 1.0; x := 1.0; x := 1.0; x := 1.0; x := 1.0; end; 30 tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin x := 1; x := 1; x := 1; x := 1; x := 1; x := 1; x := 1; x := 1; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin x := y; x := y; x := y; x := y; x := y; x := y; x := y; x := y; x := y; x := y; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin x := y + z; x := y + z; x := y + z; x := x := y + z; x := y + z; x := y + z; x := end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin x := y × z; x := y × z; x := y × z; x := end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin x := y/z; x := y/z; x := y/z; x := y/z; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin k := 1; k := 1; k := 1; k := 1; k := 1; k := 1; k := 1; k := 1; k := 1; k := 1; k := 1; k := 1; k := 1; k := 1; k := 1; k := 1; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin 31 x := y; x := y; x := y; y + z; y + z; y × z; x := y × z; k := 1.0; k := 1.0; k := 1.0; k := 1.0; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin k := l + m; k := l + m; k := l + m; k := l + m; k := l + m; k := l + m; k := l + m; k := l + m; k := l + m; k := l + m; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin k := l × m; k := l × m; k := l × m; k := l × m; k := l × m; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin k := l ÷ m; k := l ÷ m; k := l ÷ m; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin k := l; k := l; k := l; k := l; k := l; k := l; k := l; k := l; k := l; k := l; k := l; k := l; k := l; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin x := l; x := l; x := l; x := l; x := l; x := l; x := l; x := l; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin l := y; l := y; l := y; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin x := y � 2; x := y � 2; 32 end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin x := y � 3; x := y � 3; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin x := y � z; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin e1[1] := 1; e1[1] := 1; e1[1] := 1; e1[1] := 1; e1[1] := 1; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin e1[1, 1] := 1; e1[1, 1] := 1; e1[1, 1] := 1; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin e1[1, 1, 1] := 1; e1[1, 1, 1] := 1; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin l := e1[1]; l := e1[1]; l := e1[1]; l := e1[1]; l := e1[1]; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin begin real a; end; begin real a; end; begin real a; end; begin real a; end; begin real a; end; 33 end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin begin array a[1 : 1]; end; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin begin array a[1 : 500]; end; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin begin array a[1 : 1, 1 : 1]; end; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin begin array a[1 : 1, 1 : 1, 1 : 1]; end; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin goto l0; l0: ; goto l1; l1: ; goto l2; l2: ; goto l3; l3: ; goto l4; l4: ; goto l5; l5: ; goto l6; l6: ; goto l7; l7: ; goto l8; 34 l8: ; goto l9; l9: ; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin begin switch s := q; goto s[1]; q : end; end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do x := sin(y); tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do x := cos(y); tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin x := abs(y); x := abs(y); x := abs(y); x := abs(y); x := abs(y); end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do x := exp(y); tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do x := ln(y); tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do x := sqrt(y); tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do x := arctan(y); tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin x := sign(y); x := sign(y); x := sign(y); end; 35 tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do begin x := entier(y); x := entier(y); end; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do p0; tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do p1(x); tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do p2(x, y); tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do p2(x, y, z); tt[case] := cputime; case := case + 1; for i := 1 step 1 until n do ; tt[case] := cputime; printt; end The output from the program consists of 43 numbers. The first 41 numbers give the time in the units provided by cputime for executing the repeated state ment and the for loop control code. The next number is the time to execute the for loop alone. The last number is proportional to the mix figure for the machine. The actual value is the mix figure times the unit of time given by cputime measured in microseconds. 36 6 Instructions for running the program 1. Code the procedures outreal and cputime for your machine. The procedure outreal prints a real number to full accuracy on the output device. This is the only output, but the procedure is called 43 times. The procedure cputime gives as a real number the amount of processor time taken by the program so far. The units are arbitrary but microseconds are to be preferred. 2. Set n, the number of times the timing loop is obeyed, to a suitable value. If the clock resolution is m microseconds, then try n = 10 × m. The time taken for the program is about n / (100 * speed of machine relative to Atlas) seconds. 3. Punch up the program and run it. Alternatively, the program can be ob tained in most card codes from NPL (please state card code and hardware representation precisely). 4. Check the results in the following way. (a) If the times for x := sin(y), x := cos(y) are radically different, something is wrong. Check the procedure cputime and the way in which the program was run (can it be multi-programmed?). Was n large enough? (b) Re-run to see how consistent the results are. (c) With the shorter times, find the machine-code generated and check the following. Firstly that the repeated statements give repeated code. Secondly that the estimated time from the machine manual agrees with the observed times. 5. Send the program and results (with listings) to the author. Any comments on the checks performed would be useful. Additional details should include (a) Compiler release specification, example: XALT Mk5 released 2/71 (b) Computer specification, example: with 4-way interleaved store. 1906A (c) Compiling and run-time options, example: TRACE 0, OPTIMIZE 3 (d) Checks, example: The times were consistent to 2 percent, and the statements x := y, x := y + z and e1[1] := 1 were checked against the machine specification for agreement with the observed times. (e) Please inform the author if the information is confidential. The author should be able to provide an analysis on the lines of the others appearing in this report within about a week of receipt of any times. 7 Analysis output 37 7.1 Statement times ALGOL compiler analysis program, date: 05/10/73. Major ALGOL systems. Ob served and estimated times. All times are in microseconds, but some are not available, in which case an estimate has been calculated (and marked with a star). ATLAS MU5 1906A RRE B5500 statement XALT Mk5 ALGOL 68 6.0 0.52 1.4 14.0 12.1 x := 1.0 6.0 0.52 1.3 54.0 8.1 x := 1 6.0 0.52 1.4 *12.6 11.6 x := y 9.0 0.62 2.0 23.0 18.8 x := y + z 12.0 0.82 3.2 39.0 50.0 x := y × z 18.0 2.02 7.2 71.0 32.5 x := y/z 9.0 0.52 1.0 8.0 8.1 k := 1 18.0 0.52 0.9 121.0 25.0 k := 1.0 12.0 0.62 2.5 13.0 18.8 k := l + m 15.0 1.07 4.9 75.0 35.0 k := l × m 48.0 1.66 6.7 45.0 34.6 k := l ÷ m 9.0 0.52 1.9 8.0 11.6 k := l 6.0 0.72 3.1 44.0 11.8 x := l 18.0 0.72 8.0 122.0 26.1 l := y 39.0 0.82 20.3 180.0 46.6 x := y � 2 48.0 1.12 23.0 213.0 85.0 x := y � 3 120.0 10.60 55.0 978.0 1760.0 x := y � z 21.0 0.72 1.8 22.0 24.0 e1[1] := 1 27.0 1.37 1.9 54.0 42.8 e1[1, 1] := 1 33.0 2.02 1.9 106.0 66.6 e1[1, 1, 1] := 1 15.0 0.72 2.4 22.0 23.5 l := e1[1] 45.0 1.74 0.4 52.0 22.3 begin real a; end 96.0 2.14 80.0 242.0 2870.0 begin array a[1 : 1]; end 96.0 2.14 86.0 232.0 2870.0 begin array a[1 : 500]; end 156.0 2.96 106.0 352.0 8430.0 begin array a[1 : 1, 1 : 1]; end 216.0 3.46 124.0 452.0 13000.0 begin array a[1 : 1, 1 : 1, 1 : 1]; end 42.0 1.56 3.5 16.0 31.5 begin goto abcd; abcd : end 129.0 2.08 9.4 62.0 98.3 begin switch s := q; goto s[1]; q : end 210.0 24.60 73.0 692.0 598.0 x := sin(y) 222.0 25.00 73.0 462.0 758.0 x := cos(y) 84.0 *0.58 17.3 22.0 14.0 x := abs(y) 270.0 *10.20 71.0 562.0 740.0 x := exp(y) 261.0 *7.30 24.7 462.0 808.0 x := ln(y) 246.0 *6.77 73.0 432.0 605.0 x := sqrt(y) 272.0 *12.90 91.0 622.0 841.0 x := arctan(y) 99.0 *1.38 18.7 72.0 37.5 x := sign(y) 99.0 *2.70 24.7 152.0 41.1 x := entier(y) 54.0 2.18 43.0 72.0 31.0 p0 69.0 *6.61 57.0 92.0 39.0 p1(x) 75.0 *8.28 65.0 132.0 45.0 p2(x, y) 93.0 *9.75 71.0 162.0 53.0 p2(x, y, z) 57.0 *0.92 8.6 17.0 38.5 loop time 38 B6700 5.5 2.7 3.9 5.5 11.3 18.0 2.9 2.7 6.0 8.9 10.3 4.3 3.6 6.0 10.8 20.2 108.0 5.3 7.7 11.3 6.7 33.8 408.0 408.0 1250.0 1330.0 1.7 47.5 161.0 171.0 5.5 250.0 192.0 262.0 221.0 11.5 15.4 26.4 28.6 30.5 33.6 7.2 X8 Petten 19.0 13.5 15.0 25.0 30.0 80.0 7.5 17.5 15.0 20.0 105.0 10.0 12.5 17.5 200.0 220.0 168.0 50.0 100.0 250.0 25.0 108.0 448.0 453.0 595.0 1120.0 3.5 273.0 460.0 510.0 18.0 755.0 667.0 380.0 795.0 20.0 25.0 173.0 300.0 425.0 560.0 80.0 X9 Eindhoven 10.8 10.8 16.0 24.0 31.3 87.5 8.2 8.2 22.4 30.4 171.0 10.6 13.5 20.7 32.0 352.0 186.0 129.0 284.0 425.0 82.4 270.0 1250.0 1490.0 1940.0 1650.0 2.8 1260.0 512.0 568.0 32.4 824.0 726.0 430.0 858.0 36.0 41.0 374.0 448.0 522.0 596.0 72.0 KDF9 Egdon 22.0 26.5 22.0 32.7 32.7 45.2 18.3 54.6 32.7 34.0 134.0 22.0 28.7 54.6 402.0 435.0 360.0 38.7 67.8 247.0 42.7 16.3 226.0 226.0 509.0 600.0 10.0 465.0 547.0 595.0 22.7 434.0 301.0 269.0 1040.0 32.0 63.1 276.0 295.0 325.0 356.0 *49.3 39 KDF9 Mk2 22.0 21.0 22.0 32.7 32.7 45.2 18.0 92.0 32.7 34.0 122.0 22.0 113.0 86.0 25.0 41.0 882.0 46.0 89.0 361.0 48.0 34.0 758.0 763.0 891.0 1030.0 25.0 582.0 629.0 664.0 124.0 647.0 753.0 396.0 1080.0 219.0 302.0 74.0 85.0 114.0 136.0 129.0 statement x := 1.0 x := 1 x := y x := y + z x := y × z x := y/z k := 1 k := 1.0 k := l + m k := l × m k := l ÷ m k := l x := l l := y x := y � 2 x := y � 3 x := y � z e1[1] := 1 e1[1, 1] := 1 e1[1, 1, 1] := 1 l := e1[1] begin real a; end begin array a[1 : 1]; end begin array a[1 : 500]; end begin array a[1 : 1, 1 : 1]; end begin array a[1 : 1, 1 : 1, 1 : 1]; end begin goto abcd; abcd : end begin switch s := q; goto s[1]; q : end x := sin(y) x := cos(y) x := abs(y) x := exp(y) x := ln(y) x := sqrt(y) x := arctan(y) x := sign(y) x := entier(y) p0 p1(x) p2(x, y) p2(x, y, z) loop time Babel KDF9 22.0 22.0 22.0 32.7 32.7 45.2 17.0 37.0 32.7 34.0 132.0 22.0 126.0 40.0 230.0 258.0 1350.0 41.6 75.7 138.0 44.8 1380.0 1950.0 1950.0 2100.0 2440.0 1910.0 174.0 713.0 751.0 21.0 724.0 820.0 455.0 1180.0 23.0 162.0 1510.0 1600.0 1630.0 1660.0 42.0 CDC 6600 2.2 2.1 2.0 2.5 2.9 4.8 2.1 1.9 2.6 3.0 6.0 2.1 2.1 4.1 3.8 4.6 124.0 2.8 2.8 4.6 3.5 41.0 72.4 71.0 75.1 75.7 9.6 60.5 60.2 58.8 4.2 61.5 60.2 49.5 62.6 7.0 39.5 89.5 94.3 99.8 105.0 13.5 CDC 7600 0.18 0.23 0.16 0.30 0.31 0.60 0.35 0.44 0.31 0.31 1.24 0.22 0.20 0.88 0.38 0.39 24.30 2.00 1.06 1.92 0.93 7.59 12.40 12.50 13.00 13.70 1.81 11.80 14.00 11.60 0.31 12.60 11.60 9.51 12.50 0.93 7.92 16.80 17.90 18.90 19.60 2.33 6600 Pascal 0.90 1.30 0.90 1.70 1.90 3.80 0.60 1.80 1.20 2.50 7.20 0.90 1.60 2.20 1.60 2.60 124.00 0.60 0.60 0.60 0.90 *3.29 *22.70 *30.60 *31.10 *36.90 0.60 *9.28 60.20 58.80 *1.29 61.50 60.20 49.50 62.60 *3.08 *6.03 1.70 2.60 3.50 4.40 *2.06 ICL 4/75 6.93 19.80 4.65 9.25 17.25 24.70 2.47 48.50 5.06 9.70 17.20 3.14 22.20 49.50 102.00 110.00 582.00 14.20 25.20 120.00 21.50 3.17 155.00 155.00 188.00 214.00 7.50 175.00 564.00 571.00 158.00 585.00 587.00 470.00 755.00 174.00 233.00 135.00 143.00 150.00 158.00 49.50 40 statement x := 1.0 x := 1 x := y x := y + z x := y × z x := y/z k := 1 k := 1.0 k := l + m k := l × m k := l ÷ m k := l x := l l := y x := y � 2 x := y � 3 x := y � z e1[1] := 1 e1[1, 1] := 1 e1[1, 1, 1] := 1 l := e1[1] begin real a; end begin array a[1 : 1]; end begin array a[1 : 500]; end begin array a[1 : 1, 1 : 1]; end begin array a[1 : 1, 1 : 1, 1 : 1]; end begin goto abcd; abcd : end begin switch s := q; goto s[1]; q : end x := sin(y) x := cos(y) x := abs(y) x := exp(y) x := ln(y) x := sqrt(y) x := arctan(y) x := sign(y) x := entier(y) p0 p1(x) p2(x, y) p2(x, y, z) loop time 4/75 ALGOL W 3.38 13.00 3.28 7.01 9.86 14.00 2.71 80.80 5.04 11.70 16.30 3.03 15.30 81.90 8.71 134.00 184.00 11.10 20.50 31.40 10.40 26.30 59.90 59.70 89.40 117.00 4.07 23.80 152.00 146.00 4.43 144.00 132.00 113.00 135.00 *21.10 98.10 43.50 111.00 178.00 241.00 9.30 360/67 ALGOL W 2.09 2.25 2.17 4.36 6.47 9.46 1.55 43.30 3.69 11.10 14.70 2.10 11.80 43.40 6.35 10.60 236.00 4.54 11.10 17.70 5.10 31.20 74.60 74.20 101.00 127.00 2.57 5.56 106.00 102.00 2.87 122.00 87.40 83.10 89.00 10.20 55.20 31.60 45.60 61.60 76.70 7.98 370/165 ALGOL W 2.00 6.02 1.80 1.80 1.80 1.87 2.00 8.47 1.80 1.80 2.13 1.80 3.80 10.50 1.80 12.70 23.00 2.80 5.64 8.40 13.80 7.47 20.10 180.00 26.50 32.60 8.02 0.24 16.50 15.40 1.80 17.60 20.40 15.20 16.50 15.60 10.50 7.91 8.10 10.80 10.10 *3.12 41 370/165 F 1.40 1.90 1.40 1.40 1.40 2.70 1.40 4.50 1.40 1.40 1.90 1.40 1.90 4.70 11.70 12.30 53.60 1.60 1.70 1.70 1.60 19.40 130.00 242.00 137.00 138.00 0.60 35.20 20.10 19.40 1.40 23.60 19.70 24.70 29.20 3.00 5.70 31.60 60.70 83.60 108.00 *3.75 360/65 Single 6.00 23.10 4.70 45.00 7.00 10.20 5.30 34.60 3.90 11.50 15.50 4.30 21.00 32.40 50.00 53.00 135.00 6.30 4.90 6.70 6.50 70.00 491.00 570.00 505.00 526.00 *6.01 130.00 91.00 91.00 4.00 107.00 75.00 75.00 84.00 27.00 51.00 138.00 271.00 387.00 483.00 2.70 statement x := 1.0 x := 1 x := y x := y + z x := y × z x := y/z k := 1 k := 1.0 k := l + m k := l × m k := l ÷ m k := l x := l l := y x := y � 2 x := y � 3 x := y � z e1[1] := 1 e1[1, 1] := 1 e1[1, 1, 1] := 1 l := e1[1] begin real a; end begin array a[1 : 1]; end begin array a[1 : 500]; end begin array a[1 : 1, 1 : 1]; end begin array a[1 : 1, 1 : 1, 1 : 1]; end begin goto abcd; abcd : end begin switch s := q; goto s[1]; q : end x := sin(y) x := cos(y) x := abs(y) x := exp(y) x := ln(y) x := sqrt(y) x := arctan(y) x := sign(y) x := entier(y) p0 p1(x) p2(x, y) p2(x, y, z) loop time 360/65 Delft 7.70 7.50 7.30 8.50 15.70 22.50 5.60 6.30 6.50 15.30 20.70 6.80 24.80 36.70 12.00 76.00 251.00 36.00 56.00 66.00 36.00 4.00 104.00 91.00 138.00 181.00 *6.66 60.00 148.00 149.00 10.00 160.00 103.00 109.00 186.00 28.00 52.00 93.00 154.00 227.00 269.00 22.20 PDP10 5.93 5.74 7.58 14.80 20.10 28.20 6.18 6.20 11.80 19.20 28.20 7.16 57.30 51.30 21.40 123.00 85.70 10.60 14.70 19.80 11.60 28.50 280.00 277.00 395.00 553.00 2.33 96.30 211.00 268.00 6.92 226.00 26.10 144.00 211.00 75.50 82.80 224.00 368.00 455.00 593.00 11.90 ALCOR 7094/1 6.50 10.00 7.50 9.50 *15.10 16.50 6.50 30.00 11.00 15.00 45.00 8.50 6.50 29.50 15.50 33.50 381.00 25.00 21.00 22.00 9.00 7.00 308.00 308.00 418.00 526.00 *8.26 205.00 265.00 311.00 11.50 206.00 80.00 168.00 336.00 16.00 28.00 281.00 407.00 503.00 598.00 *22.20 Simula 1108 1.51 1.46 1.51 3.36 4.34 9.86 0.98 0.86 2.26 3.77 12.90 1.58 1.96 12.40 4.57 7.71 50.00 2.57 5.71 8.86 3.37 25.50 83.10 81.70 97.70 113.00 1.62 112.00 43.40 39.10 1.42 35.10 34.00 32.60 56.00 3.90 13.70 44.90 50.00 52.60 54.00 8.28 42 NU ALGOL 1108 1.5 1.5 1.5 3.4 *4.0 10.3 1.0 1.0 2.3 3.4 12.5 1.5 2.7 3.1 9.7 9.3 9.7 2.7 5.8 9.0 3.4 46.3 161.0 918.0 181.0 161.0 0.7 97.4 38.6 39.4 1.5 25.7 34.9 33.1 58.1 5.8 13.4 113.0 127.0 137.0 148.0 8.7 statement x := 1.0 x := 1 x := y x := y + z x := y × z x := y/z k := 1 k := 1.0 k := l + m k := l × m k := l ÷ m k := l x := l l := y x := y � 2 x := y � 3 x := y � z e1[1] := 1 e1[1, 1] := 1 e1[1, 1, 1] := 1 l := e1[1] begin real a; end begin array a[1 : 1]; end begin array a[1 : 500]; end begin array a[1 : 1, 1 : 1]; end begin array a[1 : 1, 1 : 1, 1 : 1]; end begin goto abcd; abcd : end begin switch s := q; goto s[1]; q : end x := sin(y) x := cos(y) x := abs(y) x := exp(y) x := ln(y) x := sqrt(y) x := arctan(y) x := sign(y) x := entier(y) p0 p1(x) p2(x, y) p2(x, y, z) loop time KDF9 Whetstone 988.0 1030.0 1080.0 1750.0 1760.0 1710.0 995.0 1090.0 1800.0 1810.0 1780.0 1100.0 1120.0 1190.0 1890.0 11920.0 2550.0 1780.0 2160.0 2510.0 1940.0 1670.0 3130.0 3060.0 3760.0 4360.0 936.0 5610.0 4720.0 4610.0 4110.0 4700.0 4720.0 4440.0 5130.0 4130.0 4280.0 2010.0 3550.0 4570.0 5720.0 3930.0 Sigma 9 3.20 3.09 2.92 6.09 7.74 12.20 3.17 2.83 4.13 7.46 13.10 3.02 12.90 47.10 90.00 96.40 174.00 7.46 13.10 18.70 7.74 94.90 259.00 2520.00 297.00 339.00 2.80 293.00 135.00 139.00 3.20 143.00 104.00 17.30 153.00 18.40 111.00 285.00 533.00 773.00 1020.00 23.30 ODRA 1204 78.8 655.0 78.9 200.0 473.0 1260.0 39.0 344.0 55.8 146.0 483.0 39.1 657.0 344.0 1900.0 2370.0 9840.0 626.0 952.0 1990.0 626.0 39.2 1720.0 1720.0 2260.0 2800.00 11.40 300.00 4660.00 4550.00 164.00 5550.00 5010.00 1650.00 6760.00 760.00 816.00 1480.00 2770.00 4050.00 5340.00 116.0 H 6050 7.53 7.48 4.02 5.90 7.38 11.30 2.61 2.93 4.76 7.36 11.20 3.71 7.75 22.70 7.45 10.50 102.00 7.70 9.91 17.40 6.53 8.93 115.00 122.00 258.00 358.00 1.80 88.00 602.00 557.00 97.40 237.00 104.00 186.00 257.00 105.00 104.00 57.60 95.40 129.00 168.00 11.30 43 Simula CDC 3300 9.80 9.75 9.92 16.40 24.80 30.50 5.19 5.00 10.80 15.60 *42.40 7.23 26.70 32.30 24.50 39.50 *342.00 32.60 42.70 52.50 31.20 253.00 415.00 4800.00 454.00 541.00 1.60 383.00 246.00 281.00 18.00 263.00 43.00 195.00 290.00 35.30 48.00 474.00 633.00 766.00 898.00 21.00 statement x := 1.0 x := 1 x := y x := y + z x := y × z x := y/z k := 1 k := 1.0 k := l + m k := l × m k := l ÷ m k := l x := l l := y x := y � 2 x := y � 3 x := y � z e1[1] := 1 e1[1, 1] := 1 e1[1, 1, 1] := 1 l := e1[1] begin real a; end begin array a[1 : 1]; end begin array a[1 : 500]; end begin array a[1 : 1, 1 : 1]; end begin array a[1 : 1, 1 : 1, 1 : 1]; end begin goto abcd; abcd : end begin switch s := q; goto s[1]; q : end x := sin(y) x := cos(y) x := abs(y) x := exp(y) x := ln(y) x := sqrt(y) x := arctan(y) x := sign(y) x := entier(y) p0 p1(x) p2(x, y) p2(x, y, z) loop time ALGOL CDC 3300 8.35 8.35 8.60 14.60 23.20 28.90 8.35 8.35 13.00 25.90 35.20 8.65 29.70 58.20 23.10 37.70 848.00 35.70 50.00 64.40 36.10 378.00 530.00 530.00 536.00 541.00 76.00 188.00 491.00 520.00 10.60 521.00 313.00 450.00 604.00 34.00 122.00 694.00 892.00 1030.00 1160.00 41.80 TR4 18.1 18.0 18.1 29.4 46.1 70.5 18.1 18.1 28.0 46.1 *86.8 18.1 18.0 126.0 44.0 93.0 346.0 129.0 167.0 203.0 127.0 16.0 1970.0 1970.0 2540.0 3100.0 38.0 *285.0 695.0 677.0 117.0 810.0 855.0 132.0 724.0 138.0 212.0 120.0 202.0 278.0 353.0 *63.3 Siemens 4004/55 10.0 78.0 11.0 25.0 40.0 125.0 7.8 110.0 12.0 30.0 120.0 7.7 78.0 120.0 140.0 160.0 650.0 40.0 120.0 160.0 40.0 90.0 200.0 200.0 270.0 320.0 10.0 170.0 2800.0 2800.0 15.0 770.0 250.0 270.0 16200.0 92.0 160.0 250.0 370.0 550.0 670.0 15.0 statement x := 1.0 x := 1 x := y x := y + z x := y × z x := y/z k := 1 k := 1.0 k := l + m k := l × m k := l ÷ m k := l x := l l := y x := y � 2 x := y � 3 x := y � z e1[1] := 1 e1[1, 1] := 1 e1[1, 1, 1] := 1 l := e1[1] begin real a; end begin array a[1 : 1]; end begin array a[1 : 500]; end begin array a[1 : 1, 1 : 1]; end begin array a[1 : 1, 1 : 1, 1 : 1]; end begin goto abcd; abcd : end begin switch s := q; goto s[1]; q : end x := sin(y) x := cos(y) x := abs(y) x := exp(y) x := ln(y) x := sqrt(y) x := arctan(y) x := sign(y) x := entier(y) p0 p1(x) p2(x, y) p2(x, y, z) loop time 44 7.2 Statement factors ALGOL compiler analysis program, date: 27/01/72. 24 ALGOL systems. These factors are in microseconds and represent the time a hypothetical system would take of unit processing speed, one instruction time corresponds to about 3 microseconds. 6.4 9.3 6.2 9.8 14.7 22.1 4.8 13.6 8.7 15.5 28.1 5.9 13.7 24.5 34.4 64.2 229.0 13.9 21.2 35.1 13.6 24.3 285.0 344.0 411.0 485.0 7.7 101.0 232.0 237.0 15.1 249.0 177.0 198.0 297.0 30.5 59.2 110.0 145.0 171.0 198.0 22.8 x := 1.0 x := 1 x := y x := y + z x := y × z x := y/z k := 1 k := 1.0 k := l + m k := l × m k := l ÷ m k := l x := l l := y x := y � 2 x := y � 3 x := y � z e1[1] := 1 e1[1, 1] := 1 e1[1, 1, 1] := 1 l := e1[1] begin real a; end begin array a[1 : 1]; end begin array a[1 : 500]; end begin array a[1 : 1, 1 : 1]; end begin array a[1 : 1, 1 : 1, 1 : 1]; end begin goto abcd; abcd : end begin switch s := q; goto s[1]; q : end x := sin(y) x := cos(y) x := abs(y) x := exp(y) x := ln(y) x := sqrt(y) x := arctan(y) x := sign(y) x := entier(y) p0 p1(x) p2(x, y) p2(x, y, z) loop time 45 7.3 Residuals ALGOL compiler analysis program, date: 05/10/73. Major ALGOL systems. Residual matrix after iteration. Gives ration observed/estimated times. Values greater than 2 indicate poor implementation,values less than 0.5 indicate good implementation (of appropriate statement). ATLAS MU5 1906A RRE B5500 statement XALT Mk5 ALGOL 68 0.882 1.770 0.851 1.070 0.960 x := 1.0 0.642 1.280 0.575 3.000 0.468 x := 1 0.921 1.840 0.888 *1.000 0.960 x := y 0.861 1.370 0.791 1.140 0.970 x := y + z 0.829 1.310 0.914 1.400 1.860 x := y × z 0.763 1.980 1.260 1.560 0.743 x := y/z 1.720 2.290 0.789 0.792 0.834 k := 1 1.360 0.908 0.282 4.750 1.020 k := 1.0 1.390 1.660 1.200 0.783 1.180 k := l + m 1.060 1.740 1.430 2.740 1.330 k := l × m 1.640 1.310 0.949 0.800 0.640 k := l ÷ m 1.470 1.960 1.280 0.678 1.020 k := l 0.416 1.150 0.889 1.580 0.441 x := l 0.645 0.596 1.190 2.270 0.505 l := y 1.370 0.663 2.940 3.270 0.880 x := y � 2 0.954 0.514 1.890 2.200 0.912 x := y � 3 0.509 1.040 0.964 2.150 4.030 x := y � z 1.330 1.050 0.470 0.720 0.817 e1[1] := 1 1.130 1.320 0.328 1.170 0.965 e1[1, 1] := 1 0.873 1.230 0.208 1.460 0.951 e1[1, 1, 1] := 1 0.928 1.030 0.614 0.706 0.784 l := e1[1] 1.330 1.180 0.049 0.794 0.354 begin real a; end 0.409 0.211 1.410 0.535 6.610 begin array a[1 : 1]; end 0.304 0.157 1.130 0.381 4.910 begin array a[1 : 500]; end 0.486 0.213 1.370 0.569 14.200 begin array a[1 : 1, 1 : 1]; end 0.567 0.210 1.350 0.615 18.400 begin array a[1 : 1, 1 : 1, 1 : 1]; end 5.300 4.540 1.830 1.050 2.140 begin goto abcd; abcd : end 1.350 0.501 0.406 0.336 0.553 begin switch s := q; goto s[1]; q : end 0.856 2.320 1.230 1.460 1.310 x := sin(y) 0.895 2.330 1.220 0.996 1.650 x := cos(y) 6.310 *1.000 5.380 0.858 0.568 x := abs(y) 1.150 *1.000 1.250 1.240 1.700 x := exp(y) 1.550 *1.000 0.606 1.420 2.590 x := ln(y) 1.570 *1.000 1.930 1.430 2.090 x := sqrt(y) 0.912 *1.000 1.260 1.080 1.520 x := arctan(y) 3.110 *1.000 2.430 1.170 0.636 x := sign(y) 1.590 *1.000 1.640 1.270 0.356 x := entier(y) 0.506 0.471 1.660 0.350 0.157 p0 0.452 *1.000 1.540 0.312 0.138 p1(x) 0.392 *1.000 1.410 0.358 0.127 p2(x, y) 0.413 *1.000 1.300 0.373 0.127 p2(x, y, z) 2.680 *1.000 1.670 0.415 0.977 loop time 46 B6700 1.570 0.561 1.160 1.020 1.510 1.480 1.070 0.396 1.350 1.220 0.685 1.360 0.484 0.418 0.734 0.779 0.891 0.649 0.624 0.580 0.804 1.930 3.380 2.510 7.530 6.760 0.416 0.962 1.270 1.330 0.820 2.060 2.210 3.250 1.440 0.701 0.480 0.480 0.363 0.310 0.290 0.657 X8 Petten 1.410 0.729 1.160 1.210 1.050 1.710 0.723 0.668 0.879 0.711 1.820 0.825 0.437 0.317 3.540 2.210 0.360 1.590 2.110 3.340 0.781 1.610 0.964 0.725 0.936 1.480 0.223 1.440 0.946 1.040 0.683 1.620 2.000 1.230 1.350 0.317 0.203 0.818 0.992 1.120 1.260 1.900 X9 Eindhoven 0.597 0.435 0.924 0.864 0.813 1.400 0.589 0.233 0.978 0.805 2.200 0.652 0.352 0.279 0.422 2.630 0.297 3.060 4.460 4.230 1.920 2.990 2.000 1.780 2.270 1.630 0.133 4.940 0.785 0.862 0.916 1.320 1.620 1.040 1.080 0.416 0.248 1.320 1.100 1.030 0.996 1.270 KDF9 Egdon 1.390 1.220 1.460 1.350 0.973 0.826 1.500 1.780 1.640 1.030 1.980 1.550 0.857 0.844 6.060 3.730 0.658 1.050 1.220 2.820 1.140 0.207 0.415 0.308 0.684 0.679 0.543 2.090 0.961 1.030 0.735 0.795 0.769 0.743 1.500 0.433 0.437 1.120 0.832 0.732 0.681 *1.000 47 KDF9 Mk2 1.160 0.808 1.210 1.130 0.812 0.689 1.240 2.500 1.360 0.861 1.380 1.290 2.820 1.110 0.315 0.293 1.340 1.040 1.340 3.440 1.070 0.360 1.160 0.869 0.999 0.973 1.130 2.180 0.922 0.963 3.350 0.990 1.610 0.911 1.310 2.480 1.740 0.249 0.200 0.214 0.217 2.180 statement x := 1.0 x := 1 x := y x := y + z x := y × z x := y/z k := 1 k := 1.0 k := l + m k := l × m k := l ÷ m k := l x := l l := y x := y � 2 x := y � 3 x := y � z e1[1] := 1 e1[1, 1] := 1 e1[1, 1, 1] := 1 l := e1[1] begin real a; end begin array a[1 : 1]; end begin array a[1 : 500]; end begin array a[1 : 1, 1 : 1]; end begin array a[1 : 1, 1 : 1, 1 : 1]; end begin goto abcd; abcd : end begin switch s := q; goto s[1]; q : end x := sin(y) x := cos(y) x := abs(y) x := exp(y) x := ln(y) x := sqrt(y) x := arctan(y) x := sign(y) x := entier(y) p0 p1(x) p2(x, y) p2(x, y, z) loop time Babel KDF9 0.754 0.549 0.787 0.729 0.527 0.447 0.756 0.652 0.885 0.558 1.050 0.838 2.040 0.334 1.880 1.200 1.340 0.612 0.737 0.849 0.646 9.460 1.940 1.440 1.530 1.490 56.200 0.423 0.677 0.706 0.368 0.718 1.130 0.679 0.921 0.168 0.606 3.300 2.440 1.980 1.720 0.460 CDC 6600 1.130 0.784 1.070 0.835 0.699 0.710 1.400 0.502 1.050 0.737 0.717 1.200 0.508 0.513 0.464 0.319 1.830 0.617 0.408 0.425 0.756 4.210 1.080 0.785 0.817 0.693 4.230 2.200 0.856 0.827 1.100 0.913 1.250 1.110 0.733 0.768 2.210 2.920 2.150 1.820 1.630 2.220 CDC 7600 0.544 0.517 0.520 0.602 0.449 0.528 1.380 0.688 0.750 0.458 0.890 0.738 0.291 0.657 0.276 0.163 2.160 2.640 0.930 1.060 1.200 4.670 1.100 0.825 0.846 0.750 4.770 2.580 1.190 0.980 0.489 1.120 1.430 1.270 0.879 0.612 2.660 3.280 2.450 2.070 1.820 2.290 6600 Pascal 1.370 1.440 1.430 1.680 1.360 1.660 1.180 1.410 1.440 1.820 2.550 1.520 1.150 0.815 0.578 0.534 5.430 0.391 0.259 0.164 0.575 *1.000 *1.000 *1.000 *1.000 *1.000 0.781 *1.000 2.530 2.450 *1.000 2.700 3.690 3.270 2.170 *1.000 *1.000 0.164 0.176 0.189 0.202 *1.000 ICL 4/75 0.765 1.590 0.536 0.664 0.907 0.787 0.354 2.750 0.441 0.512 0.441 0.385 1.160 1.330 2.680 1.640 1.850 0.675 0.792 2.380 0.998 0.070 0.497 0.370 0.441 0.422 0.710 1.370 1.720 1.730 8.910 1.870 2.610 2.260 1.900 4.110 2.800 0.952 0.703 0.591 0.527 1.750 48 statement x := 1.0 x := 1 x := y x := y + z x := y × z x := y/z k := 1 k := 1.0 k := l + m k := l × m k := l ÷ m k := l x := l l := y x := y � 2 x := y � 3 x := y � z e1[1] := 1 e1[1, 1] := 1 e1[1, 1, 1] := 1 l := e1[1] begin real a; end begin array a[1 : 1]; end begin array a[1 : 500]; end begin array a[1 : 1, 1 : 1]; end begin array a[1 : 1, 1 : 1, 1 : 1]; end begin goto abcd; abcd : end begin switch s := q; goto s[1]; q : end x := sin(y) x := cos(y) x := abs(y) x := exp(y) x := ln(y) x := sqrt(y) x := arctan(y) x := sign(y) x := entier(y) p0 p1(x) p2(x, y) p2(x, y, z) loop time 4/75 ALGOL W 0.749 2.580 0.759 1.010 1.030 0.895 0.780 9.220 0.882 1.240 0.842 0.747 1.600 4.430 0.460 4.020 1.180 1.060 1.290 1.250 0.970 1.170 0.385 0.285 0.420 0.463 0.774 0.374 0.934 0.888 0.502 0.923 1.180 1.090 0.683 *1.000 2.370 0.614 1.100 1.400 1.610 0.659 360/67 ALGOL W 0.762 0.597 0.826 1.030 1.110 0.994 0.733 8.120 1.060 1.930 1.250 0.851 2.030 3.860 0.551 0.521 2.480 0.710 1.150 1.160 0.782 2.280 0.788 0.583 0.783 0.829 0.803 0.144 1.070 1.020 0.535 1.280 1.290 1.320 0.740 0.792 2.200 0.732 0.740 0.798 0.844 0.930 370/165 ALGOL W 2.010 4.390 1.880 1.170 0.848 0.541 2.600 4.370 1.420 0.864 0.498 2.010 1.800 2.560 0.430 1.730 0.666 1.210 1.610 1.520 5.800 1.500 0.586 3.880 0.563 0.583 6.900 0.017 0.458 0.423 0.922 0.510 0.824 0.663 0.377 3.350 1.150 0.505 0.362 0.385 0.307 *1.000 49 370/165 F 1.170 1.150 1.220 0.759 0.548 0.649 1.510 1.930 0.921 0.559 0.369 1.300 0.747 0.955 2.320 1.390 1.290 0.572 0.403 0.255 0.561 3.240 3.150 4.350 2.410 2.050 0.429 2.080 0.464 0.443 0.596 0.569 0.663 0.896 0.555 0.535 0.519 1.680 2.250 2.480 2.730 *1.000 360/65 Single 1.160 3.260 0.951 0.568 0.638 0.570 1.330 3.450 0.597 1.070 0.700 0.927 1.920 1.530 2.310 1.390 0.755 0.524 0.270 0.234 0.530 2.720 2.760 2.380 2.070 1.820 *1.000 1.790 0.489 0.484 0.396 0.600 0.587 0.633 0.371 1.120 1.080 1.700 2.340 2.670 2.830 0.167 statement x := 1.0 x := 1 x := y x := y + z x := y × z x := y/z k := 1 k := 1.0 k := l + m k := l × m k := l ÷ m k := l x := l l := y x := y � 2 x := y � 3 x := y � z e1[1] := 1 e1[1, 1] := 1 e1[1, 1, 1] := 1 l := e1[1] begin real a; end begin array a[1 : 1]; end begin array a[1 : 500]; end begin array a[1 : 1, 1 : 1]; end begin array a[1 : 1, 1 : 1, 1 : 1]; end begin goto abcd; abcd : end begin switch s := q; goto s[1]; q : end x := sin(y) x := cos(y) x := abs(y) x := exp(y) x := ln(y) x := sqrt(y) x := arctan(y) x := sign(y) x := entier(y) p0 p1(x) p2(x, y) p2(x, y, z) loop time 360/65 Delft 1.350 0.955 1.330 0.968 1.290 1.140 1.270 0.567 0.898 1.280 0.844 1.320 2.050 1.570 0.500 1.800 1.270 2.700 2.780 2.080 2.650 0.140 0.528 0.343 0.512 0.565 1.000 0.745 0.718 0.715 0.894 0.810 0.727 0.830 0.742 1.050 0.994 1.040 1.200 1.410 1.420 1.240 PDP10 0.863 0.608 1.150 1.400 1.370 1.180 1.170 0.464 1.360 1.340 0.977 1.160 3.930 1.820 0.742 2.420 0.360 0.662 0.608 0.519 0.710 0.831 1.180 0.869 1.220 1.440 0.278 0.995 0.851 1.070 0.515 0.952 0.153 0.912 0.701 2.350 1.320 2.080 2.390 2.360 2.610 0.554 ALCOR 7094/1 0.917 1.030 1.100 0.872 *1.000 0.671 1.190 2.180 1.220 1.010 1.480 1.330 0.432 1.010 0.521 0.639 1.550 1.510 0.842 0.558 0.534 0.198 1.260 0.936 1.250 1.320 *1.000 2.050 1.040 1.200 0.829 0.841 0.455 1.030 1.080 0.482 0.431 2.520 2.560 2.520 2.550 *1.000 Simula 1108 0.925 0.651 0.966 1.340 1.250 1.740 0.779 0.271 1.090 1.110 1.840 1.080 0.566 1.850 0.667 0.639 0.884 0.676 0.994 0.977 0.869 3.130 1.480 1.080 1.270 1.230 0.852 4.880 0.737 0.658 0.445 0.623 0.841 0.869 0.783 0.511 0.918 1.750 1.360 1.150 1.000 1.620 50 NU ALGOL 1108 0.798 0.581 0.833 1.180 *1.000 1.580 0.690 0.274 0.966 0.866 1.550 0.887 0.677 0.402 1.230 0.669 0.149 0.616 0.877 0.862 0.761 4.930 2.480 10.500 2.040 1.530 0.319 3.680 0.569 0.575 0.408 0.395 0.749 0.766 0.705 0.659 0.778 3.820 3.010 2.590 2.380 1.480 statement x := 1.0 x := 1 x := y x := y + z x := y × z x := y/z k := 1 k := 1.0 k := l + m k := l × m k := l ÷ m k := l x := l l := y x := y � 2 x := y � 3 x := y � z e1[1] := 1 e1[1, 1] := 1 e1[1, 1, 1] := 1 l := e1[1] begin real a; end begin array a[1 : 1]; end begin array a[1 : 500]; end begin array a[1 : 1, 1 : 1]; end begin array a[1 : 1, 1 : 1, 1 : 1]; end begin goto abcd; abcd : end begin switch s := q; goto s[1]; q : end x := sin(y) x := cos(y) x := abs(y) x := exp(y) x := ln(y) x := sqrt(y) x := arctan(y) x := sign(y) x := entier(y) p0 p1(x) p2(x, y) p2(x, y, z) loop time KDF9 Whetstone 2.650 2.010 3.020 3.050 2.220 1.330 3.470 1.510 3.810 2.330 1.120 3.270 1.420 0.780 1.210 0.697 0.197 2.050 1.650 1.210 2.200 0.897 0.244 0.177 0.214 0.209 2.160 1.070 0.351 0.339 5.650 0.365 0.511 0.519 0.314 2.370 1.260 0.344 0.424 0.437 0.464 3.380 Sigma 9 0.575 0.404 0.548 0.712 0.653 0.631 0.739 0.262 0.586 0.642 0.548 0.603 1.090 2.060 3.850 2.340 0.901 0.575 0.669 0.603 0.585 3.420 1.350 9.760 1.130 1.090 0.431 3.740 0.674 0.683 0.294 0.745 0.754 0.135 0.626 0.708 2.180 3.260 4.260 4.940 5.510 1.340 ODRA 1204 0.737 4.460 0.770 1.220 2.080 3.400 0.473 1.660 0.412 0.656 1.050 0.407 2.900 0.785 4.220 3.000 2.660 2.510 2.530 3.350 2.460 0.073 0.466 0.347 0.448 0.468 0.091 0.199 1.210 1.170 0.784 1.500 1.890 0.672 1.440 1.520 0.834 0.881 1.160 1.350 1.510 0.347 H 6050 1.690 1.220 0.940 0.860 0.766 0.732 0.758 0.338 0.841 0.789 0.586 0.923 0.818 1.240 0.397 0.319 0.657 0.740 0.630 0.700 0.615 0.400 0.748 0.588 1.220 1.430 0.346 1.400 3.730 3.420 11.100 1.540 0.938 1.810 1.310 5.010 2.560 0.821 0.952 1.020 1.130 0.809 51 Simula CDC 3300 0.993 0.719 1.050 1.080 1.180 0.891 0.682 0.261 0.864 0.757 *1.000 0.814 1.280 0.799 0.591 0.541 *1.000 1.420 1.230 0.957 1.330 5.130 1.220 10.500 0.975 0.978 0.139 2.750 0.691 0.781 0.932 0.771 0.176 0.860 0.670 0.765 0.531 3.060 2.860 2.760 2.750 0.680 statement x := 1.0 x := 1 x := y x := y + z x := y × z x := y/z k := 1 k := 1.0 k := l + m k := l × m k := l ÷ m k := l x := l l := y x := y � 2 x := y � 3 x := y � z e1[1] := 1 e1[1, 1] := 1 e1[1, 1, 1] := 1 l := e1[1] begin real a; end begin array a[1 : 1]; end begin array a[1 : 500]; end begin array a[1 : 1, 1 : 1]; end begin array a[1 : 1, 1 : 1, 1 : 1]; end begin goto abcd; abcd : end begin switch s := q; goto s[1]; q : end x := sin(y) x := cos(y) x := abs(y) x := exp(y) x := ln(y) x := sqrt(y) x := arctan(y) x := sign(y) x := entier(y) p0 p1(x) p2(x, y) p2(x, y, z) loop time ALGOL CDC 3300 0.625 0.455 0.672 0.711 0.814 0.624 0.811 0.322 0.711 0.928 0.613 0.720 1.050 1.060 0.412 0.382 1.830 1.150 1.060 0.867 1.140 5.670 1.150 0.855 0.850 0.723 4.880 1.000 1.020 1.070 0.406 1.130 0.946 1.470 1.030 0.544 1.000 3.310 2.970 2.730 2.620 1.000 TR4 0.894 0.647 0.934 0.945 1.070 1.000 1.160 0.460 1.090 1.090 *1.000 0.994 0.419 1.520 0.518 0.622 0.493 2.730 2.340 1.810 2.630 0.158 2.820 2.090 2.660 2.730 1.610 *1.000 0.952 0.918 2.960 1.160 1.700 0.284 0.816 1.460 1.140 0.378 0.445 0.489 0.527 *1.000 Siemens 4004/55 0.553 3.140 0.635 0.899 1.040 1.990 0.560 3.130 0.524 0.794 1.550 0.473 2.030 1.620 1.840 1.200 1.040 0.949 1.890 1.590 0.930 0.997 0.321 0.238 0.316 0.316 0.474 0.667 4.290 4.250 0.424 1.230 0.558 0.650 20.500 1.090 0.966 0.880 0.911 1.080 1.120 0.265 statement x := 1.0 x := 1 x := y x := y + z x := y × z x := y/z k := 1 k := 1.0 k := l + m k := l × m k := l ÷ m k := l x := l l := y x := y � 2 x := y � 3 x := y � z e1[1] := 1 e1[1, 1] := 1 e1[1, 1, 1] := 1 l := e1[1] begin real a; end begin array a[1 : 1]; end begin array a[1 : 500]; end begin array a[1 : 1, 1 : 1]; end begin array a[1 : 1, 1 : 1, 1 : 1]; end begin goto abcd; abcd : end begin switch s := q; goto s[1]; q : end x := sin(y) x := cos(y) x := abs(y) x := exp(y) x := ln(y) x := sqrt(y) x := arctan(y) x := sign(y) x := entier(y) p0 p1(x) p2(x, y) p2(x, y, z) loop time 52 7.4 Statement weights ALGOL compiler analysis program, date: 05/10/73. Major ALGOL systems. Matrix of statement weights. 10000 7000 10000 26700 31200 11000 3000 500 4300 4980 481 5000 4000 500 2780 309 442 23800 16000 296 23800 0 59 59 39 0.73 2010 94 1020 1490 1390 831 644 1750 591 82 909 788 2320 2320 6050 17800 10000 7000 10000 22000 29100 11800 3000 500 4370 5800 725 5000 4000 500 5970 664 948 23300 15600 289 23300 0 32 32 22 0.40 1450 0 2600 4430 747 1700 172 719 257 103 132 308 5430 5430 7380 13400 10000 7000 10000 25400 36200 6470 3000 500 2360 3360 910 5000 4000 500 4480 497 710 23900 16100 198 23900 0 119 119 80 1.50 1710 131 104 883 741 317 888 1120 40 47 20 1020 6780 6780 2520 21000 10000 7000 10000 26900 25000 13400 3000 500 5470 5080 224 5000 4000 500 1550 172 246 25700 17300 320 25700 0 73 73 49 0.91 2410 50 539 555 1090 449 31 2200 1 2 827 798 2150 2150 6010 17400 10000 7000 10000 29900 29100 11800 3000 500 5570 5420 947 5000 4000 500 1920 214 305 24500 16400 304 24500 0 66 66 44 0.82 3110 306 646 683 1710 493 130 1420 370 65 1180 2630 1770 1770 7440 15200 10000 7000 10000 34600 35400 15400 3000 500 3970 4060 193 5000 4000 500 2710 302 431 20500 13700 255 20500 0 32 32 22 0.40 1260 13 2860 3200 1750 377 1530 3600 2710 119 3430 91 340 340 6540 14100 53 10000 7000 10000 26400 31500 10800 3000 500 4410 5260 287 5000 4000 500 1160 129 184 23000 15400 285 23000 0 46 46 31 0.57 3640 131 264 482 2420 2310 592 1630 385 22 767 573 192 192 7750 18700 10000 7000 10000 21700 32200 7130 3000 500 3950 5860 83 5000 4000 500 1680 187 267 25600 17200 319 25600 0 40 40 27 0.50 508 29 119 232 1310 167 1160 1580 372 216 9 89 2070 2070 4960 24800 statement x := 1.0 x := 1 x := y x := y + z x := y × z x := y/z k := 1 k := 1.0 k := l + m k := l × m k := l ÷ m k := l x := l l := y x := y � 2 x := y � 3 x := y � z e1[1] := 1 e1[1, 1] := 1 e1[1, 1, 1] := 1 l := e1[1] begin real a; end begin array a[1 : 1]; end begin array a[1 : 500]; end begin array a[1 : 1, 1 : 1]; end begin array a[1 : 1, 1 : 1, 1 : 1]; end begin goto abcd; abcd : end begin switch s := q; goto s[1]; q : end x := sin(y) x := cos(y) x := abs(y) x := exp(y) x := ln(y) x := sqrt(y) x := arctan(y) x := sign(y) x := entier(y) p0 p1(x) p2(x, y) p2(x, y, z) loop time 7.5 Mixes ALGOL compiler analysis program, date: 05/10/73. Major ALGOL systems. Machine factor 1.000 0.043 0.242 1.930 1.850 0.515 1.980 2.660 2.320 2.780 4.290 0.287 0.048 0.097 1.330 0.663 0.405 0.147 0.176 0.759 0.840 1.010 1.040 0.240 0.276 54.700 0.818 15.700 0.657 1.450 1.960 2.980 2.660 1/(mc. factor) 1.000 23.100 4.130 0.519 0.539 1.940 0.505 0.376 0.431 0.360 0.233 3.490 20.900 10.300 0.750 1.510 2.480 6.820 5.670 1.320 1.190 0.990 0.959 4.170 3.620 0.018 1.220 0.064 1.520 0.689 0.509 0.336 0.376 Average mix fig. 1.000 17.500 3.320 0.526 0.527 1.930 0.370 0.261 0.403 0.393 0.177 2.690 13.500 8.470 0.645 1.210 2.350 6.030 4.030 0.950 0.796 0.645 0.611 3.750 2.340 0.014 0.522 0.036 1.160 0.411 0.307 0.295 0.191 All Mix figures 0.865 12.200 2.410 0.404 0.419 1.590 0.288 0.216 0.300 0.342 0.128 1.980 9.980 6.150 0.491 0.914 1.790 5.550 2.860 0.654 0.638 0.454 0.424 2.940 1.710 0.013 0.353 0.028 0.740 0.295 0.215 0.247 0.143 1.040 18.700 3.160 0.571 0.549 2.160 0.366 0.251 0.386 0.423 0.148 2.320 11.800 10.200 0.698 1.210 2.400 5.920 3.470 0.814 0.758 0.588 0.540 3.410 1.900 0.013 0.441 0.036 1.380 0.349 0.265 0.302 0.293 1.120 20.200 3.750 0.617 0.650 2.250 0.414 0.276 0.468 0.454 0.189 2.960 14.700 11.200 0.801 1.330 2.670 6.140 4.300 1.010 0.834 0.695 0.668 4.070 2.470 0.014 0.556 0.040 1.450 0.433 0.333 0.320 0.324 54 1.070 19.000 3.440 0.582 0.626 2.210 0.389 0.262 0.423 0.430 0.162 2.640 13.300 10.600 0.738 1.230 2.490 6.060 3.870 0.903 0.794 0.622 0.595 3.700 2.190 0.014 0.487 0.038 1.310 0.388 0.298 0.307 0.234 Machine 0.800 13.400 2.760 0.386 0.369 1.320 0.317 0.243 0.331 0.295 0.184 2.570 13.000 5.220 0.443 1.050 1.900 5.740 4.230 1.010 0.765 0.625 0.596 3.420 2.500 0.013 0.582 0.031 0.773 0.437 0.304 0.256 0.084 1.030 20.300 3.770 0.582 0.581 2.020 0.394 0.278 0.468 0.415 0.191 3.090 15.500 9.410 0.714 1.320 2.560 6.320 4.530 1.070 0.860 0.720 0.705 4.220 2.760 0.014 0.589 0.040 1.390 0.469 0.353 0.309 0.255 1.110 22.600 4.150 0.654 0.652 2.400 0.426 0.287 0.487 0.437 0.234 3.210 15.900 11.500 0.808 1.450 2.870 6.320 4.800 1.160 0.878 0.795 0.745 4.370 2.780 0.014 0.633 0.043 1.700 0.492 0.375 0.325 0.292 ATLAS MU5 1906A XALT Mk5 RRE ALGOL 68 B5500 B6700 X8-Petten X8-Eindhoven KDF9-EGDON KDF9 Mk2 Babel-KDF9 CDC 6600 CDC 7600 6600, Pascal ICL 4/70 4/75, ALGOL W 360/67, ALGOL W ALGOL W, 370/165 370/65, F 360/65, Single 360/65, Delft PDP10 ALCOR 7094/1 Simula 1108 NU ALGOL 1108 KDF9 Whetstone Sigma 9 ODRA 1204 H 6050 CDC 3300, Simula CDC 3300, ALGOL TR4 Siemens 4004/55 7.6 Summary for all machines Since the last Atlas computer will soon be scrapped, and in any case, the com puter is not well known outside the UK, another standard of performance is required. In ALGOL 60, such a measure is the number of statements executed per second. This can be related to the ALGOL mix via the Whetstone inter pretive code, as illustrated in the following table: Type of Interpretive Dynamic frequency Static frequency statement instruction per million per thousand assignment STore 49 000 47.5 conditional 0.9*IF false Jump 13 900 11.5 procedure REJECT 7 450 33.1 for For Block Entry 2 700 10.2 goto GoTo Accumulator 2 010 7.4 TOTAL 75 060 109.7 Hence one million interpretive instructions correspond to about 75 000 state ments, and the ALGOL mix corresponds to about 85 000 statements. Since this takes 6.524 seconds to execute on Atlas, the computer executes 13 988 state ments per second. The summary table below has used a rounded figure of 14000. In order to indicate the variation in performance that can be expected, the stan dard deviation in the mix figure derived from seven sets of statistics given in [2], is used to calculate the likely maximum and minimum rate of executing statements. ALGOL compiler analysis program date: 04/10/73. Major ALGOL systems. Summary of analysis Unweighted Mix statements Machine measure figure per second 1.00 1.00 12 500 to 15 500 ATLAS 23.1 11.4 191 000 to 290 000 MU5 4.13 3.32 39 000 to 53 900 1906A XALT MK5 0.519 0.526 6080 to 8660 RRE ALGOL 68 0.539 0.521 5 910 to 8790 B5500 1.94 1.93 22 100 to 31 800 B6700 0.505 0.310 4 560 to 5 800 X8-Petten 0.316 0.261 3350 to 3950 X8-Eindhoven 0.434 0.408 4790 to 6 640 KDF9-EGDON 0.360 0.393 4790 to 6 210 KDF9 MK2 0.233 0.111 2050 to 2 890 Babel-KDF9 3.49 2.69 32 400 to 43 000 CDC 6600 20.9 13.5 164000 to 215 000 CDC 7600 10.2 8.56 87 200 to 152 000 6600,Pascal 55 Unweighted measure 0.750 1.51 2.48 6.81 5.71 1.32 1.19 0.9 0.968 4.17 3.61 0.018 1.22 0.064 1.52 0.691 0.511 0.339 0.376 1.06 0.400 0.496 1.52 1.55 3.82 3.70 13.9 0.121 2.89 1.05 1.29 0.186 0.296 0.251 0.129 0.115 0.894 1.04 0.828 0.885 1.08 0.276 Mix figure 0.645 1.21 2.35 6.11 4.08 0.950 0.796 0.645 0.616 3.75 2.34 0.014 0.522 0.036 1.16 0.411 0.310 0.298 0.191 0.910 0.272 0.406 1.55 1.21 2.89 2.96 8.62 0.095 2.85 0.662 0.881 0.095 0.163 0.148 0.073 0.069 0.509 0.565 0.362 0.624 0.781 0.284 statements per second 7 240 to 10 800 14 800 to 19 200 28 100 to 37 800 81 800 to 89 300 48 800 to 65 400 11 200 to 15 400 10 200 to 12 100 1 710 to 10 300 7 280 to 9 970 46 300 to 58100 27 800 to 31 800 185 to 191 6 120 to 8 500 445 to 573 11 700 to 20 100 4910 to 6600 3 660 to 5 010 3790 to 4 510 1 480 to 3 870 10 000 to 14 600 2950 to 4 680 4998 to 6370 11900 to 25 400 14 500 to 19 300 13 200 to 17 100 34 700 to 48000 107 000 to 134 000 1 010 to 1 640 33 600 to 46 100 7630 to 10 900 10 400 to 14300 1 150 to 1 510 1 850 to 2720 1 700 to 2 440 851 to 1 200 801 to 1 120 5 740 to 8 520 6 360 to 9 470 4 250 to 5 890 5680 to 11 800 7490 to 14 400 3 580 to 4360 56 Machine ICL 4/70 4/75,ALGOL W 360/67,ALGOL W ALGOL W 310/165 370/165, F 360/65,Single 360/65, Delft PDP10 ALCOR 7094/1 SIMULA 1108 NU ALGOL 1108 KDF9 Whetstone Sigma 9 ODRA 1204 H 6050 CDC3300,Simula CDC3300, ALGOL TR4 Siemens 4004/55 1904A XALT MK5 1903A XALT MK5 RRE, ALGOL 60 B6500 CDC 6400 CDC 6500/6400 CDC 6600 7600,Checking ICL 4/50 360/67,ALGOL W 360/65, F 360/65, Double 360/65, LCS 360/50, Single 360/50, Double 360/50,S,LCS 360/50,D,LCS 370/155,Double 370/155,Single SIGMA 6 H 6030 GE 635 KDF9 Mk1 Unweighted Mix statements Machine measure figure per second 0.351 0.334 3 820 to 5 530 ICL 4130 2us 0.178 0.170 2 010 to 2 760 ICL 4130 6us 0.247 0.189 2330 to 2960 ICL 503 1.44 0.804 9 720 to 12 800 CDC 3600 0.637 0.618 7 460 to 9 840 ICL 1907 0.442 0.292 3730 to 4440 EL-X8 0.163 0.138 1 550 to 2 320 E1,HARD 0.130 0.110 1 290 to 1 780 E1,SOFT 0.041 0.026 324 to 418 PDP8,EAE The mix figure is a true measure of performance as it takes into account the rel ative frequency of use of the various features of Algol. The unweighted measure is based upon a model which assumes there is a roughly constant ratio between the times. the ratio is then calculated by a least squares fit. See CCU3, CCU11 and NAC15 for full details. Caution: The performance estimates relate only to the execution rate of ALGOL 60 programs. A difference of less than 20 per cent should not be regarded as significant. The timing program should always be re-run if up-to date figures are required. 8 Acknowledgements The author would like to thank all those who have provided the statement times noted above. Dr M. G. Cox, in producing the model upon which the analysis is based, has helped significantly in the understanding of the statement times. Dr H. B. B. Clark of the London University Institute of Computer Science provided much useful comment on the analysis of the residuals. References [1] Wichmann, B.A. A comparison of ALGOL 60 execution speeds. National Physical Laboratory. Report CCU3. Jan 1969. [2] Wichmann, B.A. Some statistics from ALGOL programs. National Physical Laboratory. Report CCU11. August 1970. [3] Wichmann, B.A. The performance of some ALGOL systems. IFIP Congress 1971 Page TA-3-13. [4] Wichmann, B.A. Five ALGOL compilers. Computer Journal Feb. 1972. Pages 8-12. [5] Akka, D.S. A quantitative comparison of efficiencies of compilers. M. Sc. Thesis. Victoria University of Manchester. Oct. 1967. 57 ALGOL performance summary 300 000 MU5 200 000 7600 Statements/second 6600 PASCAL 100 000 370/165, ALGOL W 370/165 50 000 1906A 6600 40 000 1108 6400, PASCAL B6700 30 000 360/65, ALGOL W B6500 6400 20 000 4/75, ALGOL W 360/65 H6050 1904A Atlas PDP10 RRE,ALGOL68 10 000 160/65, Delft Sigma 9 4/70 Simula 3300 KDF9, mk2 X8,Petten 5 000 KDF9, Egdon RRE, Algol 60 TR4 X8 ALCOR 7094 B5500 3300 Eindhoven 1903A Figure 8: Summary for all machines 58 [6] Peck, J.E.L. (Editor) ALGOL 68 Implementation. Proc IFIP Working Conf. on ALGOL 68 Implementation. Munich. 1970. North-Holland 1971. [7] Currie, I.F. Bond, Susan, G. and Morrison, J.D. ALGOL 68-R, its imple mentation and use. IFIP Congress 1971. Page TA-3-43. [8] Ingerman, P.Z. Thunks - a way of compiling procedure statements with some comments on procedure declarations. Comm. ACM. Vol. 4 No. 1. 1961. Pages 55-58. [9] Knuth, D.E. Man or Boy. Algol Bulletin No. 17 Page 7. Mathematisch Centrum, Amsterdam 1964. [10] Hauck, E.A. and Dent, B.A. Burroughs B6500/B7500 stack mechanism. AFIPS Conf. Proc. Vol. 32 1968. SJCC Pages 245-251. [11] Bron, C. Allocation of virtual store in the T.H.E. multiprogramming sys tem: The cost of flexibility. International Seminar on Operating System Techniques, Belfast 1971. [12] Dijkstra, E.W. The structure of the T.H.E. Multiprogramming System. Comm. ACM Vol. 11 1968 Page 341. [13] Scowen, R.S. Babel, a new programming language. National Physical Lab oratory. Report CCU7. Oct. 1969. [14] Sites, R.L. ALGOL W Reference Manual. Computer Science Department Report CS-71-230. Stanford University, August 1971. [15] Wirth, N. and Hoare, C.A.R. A contribution to the development of ALGOL. Comm. ACM 9 June 1966 Pages 413-431. [16] Gries, D., Paul, M. and Wiehle, H.R. Some techniques used in the ALCOR - Illinois 7090 Compiler. Comm. ACM Vol. 8 Aug. 1965. Pages 496-500. [17] Wichmann, B.A. Basic statement times for ALGOL 60. National Physical Laboratory. Report NAC15 1972. [18] Burkat,p Kanzler, R Santo, H and Weber, 0 Messungen der. Aus fuehrungszeiten von ALGOL-60 Anweisungen. Angewandte Informatik Vol 8 1911 pp381-381. [19] Satterthwaite, E. Debugging tools for high level languages. TR29 Comput ing Laboratory, Newcastle upon Tyne, 1971 [20] Wirth, N The programming language Pascal. Acta Informatica Vol1 1911 pp35-63. [21] Curnow, H. J Some Synthetic Benchmarks. Central Computer Agency, Technical Services Division Note No. 3901 59 [22] Scowen, R.S. Babel and SOAP, applications of extensible compilers, Soft ware — Practice and Experience. Vol3 1973 pp15-27 [23] Ahmad, M. The computing speed of a new machine. Computer Journal Vol16 1973 pp 161-164. A Notes Converted to LATEX in January 2004. This transcription exploits modern type setting in a way the original did not. The program listing uses several statements per line when appropriate, unlike the original which was formatted with SOAP. (Only saves 2 pages, but I think it is clearer.) Eventually, I decided it was better to number the sections, although this was not done in the original (but the figures were numbered!). The main tables used a ‘clever’ format in the original. This would require the package dcolumn in LATEX, but I decided to change the layout slightly to have each column so that it could be right justified. Looks OK. 60
© Copyright 2025 Paperzz