Compiler tests

Some tests are performed on many different processors from 8086 to modern CPU's. Different compilers are used. Unfortunately some used compiler versions are lost and not all test programs may be recompiled but some of them may be.

Tests are program compilation, data compression and nim game solved by recursive brute force. Test programs contain some defects that, however, do not significantly affect the results.

Results depends on disk drive prefomance, environment (operating system, disk drive cache etc). Time measurement method (small program that print system clock counter value are used) and program startup time also may distort results. Some results may seems strange, for example on Am386SX disk drive cache reduce performance of program that not work with disk drive!

To increase accuracy on all modern and some old PC's tests are repeated ten or hundred times.

Toshiba T1000SE Toshiba T1000SE laptop - most oldest PC used in tests. It based on OKI M80C86A-2 (Intel 8086) 9.54MHz CPU and it's frequency may be reduced to 4.77MHz. Advanced PC Tools 5.0 program reports speed 2.55/1.25 of original IBM PC. 1Mb RAM (640Kb conventional RAM and 384Kb RAM disk). 3.5 inch floppy (broken) and 9 inch 640*400 monochrome CGA panel. MS DOS 3.30 in ROM. Produced in 1990. Because floppy is broken second PC used to transfer test programs and data to laptop RAM disk.

This laptop may be used for text processing, programming and playing old DOS games. But using of interpreted programs are problem. For example compilation of Pascal-S on it's own virtual machine requires about fifty minutes! Microsoft GW-Basic more slower.

Used compilers:

Abbr Name Comment
050 Context.pas First version of Context (1994) partially incompatible with later versions
101 Context 1.01 Minimum version of Context for DOS
130 Context 1.30 Context 1.20 with minor jump optimization
140 Context 1.40 Direct translation of Context 1.30 to Win32
201 Context 2.01 Minimum version of Context 2.0 for Win32 (Host-DOS/Target-Win32)
202 Context 2.02 Minimum version of Context 2.0 for Win32 (Host-Win32/Target-Win32)
205 Context 2.05 Context 2.02 with integer datatype
212 Context 2.12 Context 2.05 with more complex code generator
213 Context 2.13 Context 2.05 with optimizing code generator (pre-beta)
TP1 Turbo Pascal 1.00A  
TP3 Turbo Pascal 3.02A  
BP7 Borland Pascal 7.0  
BC3 Borland C++ 3.1  
BC5 Borland C++ 5.5  
VC4 Microsoft Visual C++ 4.2  

Compilation

Compilation of Context.103/Context.pas to com/exe with different compilers, seconds:

CPU\Compiler   101 130 TP1 TP3 BP7
Core i5-7600/3500/VMWare 0.113 0.007 0.006 n/a n/a 0.005
Core i5-4690S/3200 0.217 0.012 0.009 n/a n/a 0.008
Core i3-2100/3100 0.156 0.025 0.024 n/a n/a 0.008
Core i5-4690S/3200/VMWare 0.157 0.013 0.009 n/a n/a 0.013
Xeon E5450/3000/VMWare 0.221 0.019 0.016 n/a n/a 0.015
P4/2400/533 0.367 0.020 0.016 n/a n/a 0.016
Athlon 64X2/3800+/2000 0.234 0.023 0.019 n/a n/a 0.016
Athlon 64/3800+/24001) 0.191 0.019 0.016 n/a n/a 0.018
Core Duo T2600/21601) 0.192 0.019 0.016 n/a n/a 0.019
Pentium T4500/2300 0.225/TODO 0.020 0.018 n/a n/a 0.019
Celeron/2400 0.423 0.022 0.019 n/a n/a 0.020
Athlon 64/3200+/2000 0.409 0.026 0.021 n/a n/a 0.020
Athlon XP/2000+/1667 3.300 0.030 0.030 n/a n/a 0.020
Pentium E5400/2700 0.169 0.024 0.021 n/a n/a 0.025
Core2Duo E6300/1870 0.257 0.026 0.023 n/a n/a 0.025
Celeron/2000 1.064 0.032 0.027 n/a n/a 0.025
Celeron/1400 0.380 0.030 0.030 n/a n/a 0.030
PIII/1000 0.420 0.040 0.030 n/a n/a 0.030
Celeron/1000 n/a 0.040 0.030 n/a n/a 0.030
P4/1500 1.600 0.050 0.040 n/a n/a 0.030
Celeron SU2300/1200 0.456 0.036 0.034 n/a n/a 0.031
Core2Duo T8100/2100 0.230 0.036 0.034 n/a n/a 0.036
Celeron 420/1600 0.355 0.038 0.037 n/a n/a 0.038
Athlon/900 0.640 0.060 0.040 n/a n/a 0.040
Atom Z3740/1330 0.495 0.047 0.041 n/a n/a 0.041
P4/1600 0.638 0.052 0.049 n/a n/a 0.044
Celeron/667 1.900 0.090 0.070 n/a n/a 0.050
PII/350 1.010 0.080 0.070 n/a n/a 0.050
Core2Duo E6550/2330 0.327 0.049 0.047 n/a n/a 0.060
Celeron/433 1.200 0.100 0.080 n/a n/a 0.060
PII/233 1.490 0.140 0.110 n/a n/a 0.070
Atom N270/1600 1.108 0.102 0.092 n/a n/a 0.079
K6/300 4.080 0.120 0.100 n/a n/a 0.090
K6/200 1.750 0.120 0.090 n/a n/a 0.100
Celeron/266 2.050 0.130 0.090 n/a n/a 0.130
MII-PR233/187 1.660 0.150 0.130 n/a n/a 0.100
P/200MMX 1.670 0.180 0.130 n/a n/a 0.130
P/133 1.960 0.220 0.160 n/a n/a 0.140
Am486DX2/66 15.730 0.780 0.620 0.800 n/a 0.410
Am386DX/40 26.240 2.230 1.650 2.500 1.400 1.330
i386DX/33 37.350 2.930 2.180 n/a n/a 1.510
Am386SX/33/ramdrive 38.747 4.146 3.142 n/a n/a 1.732
Am386SX/33/smartdrv 40.380 4.150 3.203 4.620 2.750 1.902
Am386SX/33/Win95 58.178 4.499 3.521 5.100 3.120 1.994
Am386SX/33 42.722 4.398 3.591 4.850 2.600 2.216
Am286/16/smartdrv 65.737 6.432 4.664 7.130 4.320 2.560
Am386SX/16/smartdrv 77.778 8.190 6.284 9.280 5.340 3.384
286/123) 119.340 9.480 7.280 9.500 5.500 5.320
Am286/8/smartdrv 123.805 12.678 9.185 13.690 7.960 4.999
V30/10 175.710 17.699 13.398 18.040 9.970 6.833
8086/9.54 239.600 24.250 18.610 25.000 13.000 9.350
V30/4.77 365.636 37.062 28.032 37.660 20.780 14.326
8086/4.77 481.600 48.830 37.390 50.000 26.000 19.260

In first column you will see work time of Context.110 (ctx to asm), compiled with Context 1.01, in second and third columns - work time of Context 1.03, compiled with Context 1.01 and Context 1.30. In next three columns - Context.pas compilation time with different versions of Turbo Pascal.

Compilation of Context.202 to asm with Context 2.xx and C++ port of Context 2.07 compiled with different compilers, seconds:

CPU\Compiler 130 140 202 212 213 BC5 VC4
Core i5-7600/3500/VMWare 0.031 0.007 0.007 0.007 0.005 0.007 0.005
Xeon E3-1245 V6/3700/VMWare n/a 0.009 0.009 0.008 0.008 0.009 0.007
Core i5-4690S/3200/VMWare 0.034 0.012 0.012 0.013 0.012 0.010 0.009
Core i3-2100/3100 0.041 0.013 0.013 0.012 0.012 0.013 0.010
Xeon E3-1220 V2/3100/VMWare n/a 0.014 0.014 0.013 0.013 0.018 0.012
Xeon Platinum 8280/2700/VMWare n/a 0.015 0.014 0.014 0.014 0.025 0.012
Core i5-4690S/3200/Wine 0.046 0.015 0.015 0.014 0.013 0.052 0.012
Pentium E5400/2700 0.046 0.022 0.020 0.019 0.016 0.014 0.013
Athlon 64/3800+/24001) 0.052 0.024 0.026 0.025 0.025 0.019 0.016
Core Duo T2600/21601) 0.049 0.029 0.027 0.025 0.023 0.020 0.017
Athlon 64X2/3800+/20001) 0.067 0.027 0.030 0.029 0.029 0.023 0.019
Xeon E7-4870/2400/VMWare n/a 0.026 0.027 0.027 0.025 0.024 0.020
Core i5-7200U/2500 n/a 0.025 0.025 0.024 0.024 0.030 0.023
Core i5-10351/1000-3600 n/a 0.028 0.028 0.026 0.024 0.029 0.024
Athlon 64X2/4200+/2200 n/a 0.032 0.034 0.035 0.034 0.032 0.024
P4-630/3000/800 0.069 n/a 0.036 n/a n/a n/a n/a
Core2Duo T8100/2100 0.074 0.037 0.036 0.034 0.031 0.046 0.029
Pentium T4500/2300 0.059 0.038 0.038 0.035 0.031 0.038 0.030
Core i5-7600/3500 n/a 0.063 0.059 0.058 0.035 0.036 0.032
P4/2400/533 0.071 0.045 0.042 0.039 0.041 0.038 0.032
Core i3-7020U/2300 n/a 0.041 0.040 0.039 0.038 0.043 0.035
Core i3-10105/3700 n/a 0.042 0.043 0.041 0.040 0.040 0.036
Xeon E5450/3000/VMWare 0.059 0.050 0.048 0.044 0.043 0.044 0.038
Core i5-8250U/1600/3400 n/a 0.052 0.051 0.047 0.046 0.046 0.042
Celeron/2400 0.079 0.060 0.056 0.054 0.055 0.054 0.044
Athlon XP/2000+/16672) 0.103 n/a 0.056 n/a n/a n/a n/a
Celeron SU2300/1200 0.104 0.064 0.059 0.056 0.050 0.070 0.046
Celeron/2000 0.101 0.065 0.062 0.058 0.060 0.055 0.047
Ryzen 3 2300U/2000 n/a 0.052 0.050 0.051 0.050 0.048 0.048
Atom Z3740/1330 0.142 0.060 0.065 0.060 0.057 0.064 0.051
Celeron/14002) 0.090 n/a 0.070 n/a n/a n/a n/a
Athlon XP-M/1600+/14002) 0.100 n/a 0.080 n/a n/a n/a n/a
P4/1600 0.138 0.085 0.065 0.062 0.063 0.086 0.055
Pentium N4200/1100 n/a 0.062 0.064 0.060 0.062 0.074 0.057
PIII/1000 0.138 0.087 0.093 0.071 0.068 0.067 0.057
Atom N270/1600 0.359 0.090 0.093 0.089 0.087 0.081 0.069
Core2Duo E6300/1870 0.069 0.089 0.066 0.065 0.066 0.077 0.070
Core i3-2120/3300 n/a 0.077 0.074 0.070 0.073 0.082 0.076
Core2Duo E6550/2330 0.122 0.084 0.095 0.101 0.079 0.084 0.076
Celeron 420/1600 0.133 0.102 0.099 0.097 0.093 0.089 0.082
Ryzen 5 3500U/2100 n/a 0.073 0.075 0.073 0.073 0.067 0.090
Core i5-3210m/2500 n/a 0.104 0.104 0.108 0.102 0.147 0.096
Pentium B950/2100 n/a 0.129 0.129 0.125 0.124 0.134 0.128
Athlon 64/3200+/2000 0.200 0.165 0.168 0.168 0.165 0.140 0.136
Celeron/6672) 0.200 n/a 0.410 n/a n/a n/a n/a
PII/350 0.300 0.226 0.248 0.186 0.178 0.176 0.148
Celeron/350(266) 0.308 0.244 0.270 0.207 0.195 0.190 0.161
Celeron/2662) 0.430 n/a 0.370 n/a n/a n/a n/a
K6/200 0.438 0.369 0.358 0.331 0.309 0.305 0.241
P/1332) 0.830 n/a 0.690 n/a n/a n/a n/a
Am486DX2/66 2.600 2.650 2.520 2.300 2.250 2.280 1.790
i386DX/33 10.270 n/a n/a n/a n/a n/a n/a
Am386SX/33/ramdrive 16.134 n/a n/a n/a n/a n/a n/a
Am386SX/33/smartdrv 16.755 n/a n/a n/a n/a n/a n/a
Am386SX/33/Win95 17.446 18.378 17.824 16.252 15.527 14.851 12.616
Am386SX/33 21.724 n/a n/a n/a n/a n/a n/a
Am286/16/smartdrv 25.714 n/a n/a n/a n/a n/a n/a
Am386SX/16/smartdrv 33.349 n/a n/a n/a n/a n/a n/a
286/123) 38.110 n/a n/a n/a n/a n/a n/a
Am286/8/smartdrv 50.773 n/a n/a n/a n/a n/a n/a
V30/10 74.092 n/a n/a n/a n/a n/a n/a
8086/9.54 97.900 n/a n/a n/a n/a n/a n/a
V30/4.77 155.566 n/a n/a n/a n/a n/a n/a
8086/4.77 195.200 n/a n/a n/a n/a n/a n/a

Low results of some modern processors may be caused by slow disk subsystem?

Data compression/LZSS algorithm (arctest.ctx)

Substring match algorithm implementation (most time consuming part of test) are shown below:

byte Tmp[STR_LEN]; //Substing for match int J=pTxt; int K=0; while K<N do Tmp[K]=Txt[J]; inc K; inc J; end int D[STR_LEN1]; //STR_LEN1 = STR_LEN + 1 //Knuth-Morris-Pratt algorithm shifts array D[1]=0; J=1; K=0; while J<N do while Tmp[J]=Tmp[K] do inc J; inc K; select case J>=N: D[J]=K; exit case Tmp[J]!=Tmp[K]: D[J]=K; default: D[J]=D[K]; end end if K>0 then K=D[K]; loop end inc J; D [J]=0; end byte T=Txt[pTxt]; int M=pTxt+N; int S=0; int L=1; J=I; K=0; do while Txt[J]=Tmp[K] do if K>=N then exit end inc J; inc K; end if K>0 then if L<=K then if J>=M then exit end S=J; L=K; end K=D[K]; loop end inc J; while Txt[J]!=T do inc J; end inc J; inc K; end

Shifts calculation contains a non-critical error. More accurate implementation may be:

byte Tmp[STR_LEN]; int J=pTxt; int K=0; while K<N do Tmp[K]=Txt[J]; inc K; inc J; end int D[STR_LEN1]; D[0]=-1; J=1; K=0; while J<N do if Tmp[J]=Tmp[K] then D[J]=D[K]; inc J; inc K; else D[J]=K; K=D[K]; while K>=0 & Tmp[J]!=Tmp[K] do K=D[K]; end inc J; inc K; end end D[J]=K; byte T=Txt[pTxt]; int M=pTxt+N; int S=0; int L=1; J=I; while Txt[J]!=T do inc J; end inc J; K=1; do while K<N & Txt[J]=Tmp[K] do inc J; inc K; end if L<=K then if J>=M then exit end S=J; L=K; end K=D[K]; while K>=0 & Txt[J]!=Tmp[K] do K=D[K]; end if K<0 then inc J; while Txt[J]!=T do inc J; end inc J; K=1; else inc J; inc K; end end

There are no significant differences in execution times of this implementations, but increasing of STR_LEN constant from 34 (31 + 3) to 258 (255 + 3) reduce compression time and increase compression ratio. This changes can't be made because many old PC's are not available now.

Compression of context.asm (Context 2.02 assembly listing, 318761 bytes), seconds:

CPU\Compiler 101 130 TP1 TP3 BP7 BC3 140 205 212 213 BC5 VC4
Core i3-10105/3700 n/a n/a n/a n/a n/a n/a 0.41 0.50 0.38 0.19 0.18 0.14
Xeon E3-1245 V6/3700/VMWare n/a n/a n/a n/a n/a n/a 0.44 0.52 0.42 0.19 0.19 0.14
Core i5-7600/3500/VMWare 1.36 0.48 1.86 2.02 0.51 0.21 0.43 0.51 0.41 0.20 0.19 0.14
Core i5-4690S/3200/VMWare 1.62 0.55 2.20 2.30 0.57 0.23 0.55 0.64 0.49 0.19 0.18 0.16
Ryzen 3 2200G/3500 n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a 0.20 n/a
Core i5-4690S/3200/Wine 1.92 0.65 2.57 2.64 0.67 0.25 0.55 0.64 0.49 0.20 0.22 0.16
Core i5-7600/3500 n/a n/a n/a n/a n/a n/a 0.47 0.57 0.45 0.23 0.21 0.18
Core i5-10351/1000-3600 n/a n/a n/a n/a n/a n/a 0.66 0.66 0.64 0.24 0.21 0.18
Xeon Platinum 8280/2700/VMWare n/a n/a n/a n/a n/a n/a 0.55 0.66 0.52 0.25 0.23 0.19
Core i5-7200U/2500 n/a n/a n/a n/a n/a n/a 0.67 0.70 0.58 0.27 0.26 0.19
Xeon E3-1220 V2/3100/VMWare n/a n/a n/a n/a n/a n/a 0.68 0.80 0.62 0.29 0.28 0.21
Core i5-8250U/1600/3400 n/a n/a n/a n/a n/a n/a 0.56 0.67 0.53 0.27 0.28 0.23
Core i3-2100/3100 2.02 0.68 2.70 2.81 0.69 0.28 0.71 0.83 0.64 0.30 0.28 0.25
Ryzen 3 2300U/2000 n/a n/a n/a n/a n/a n/a 0.87 0.88 0.86 0.32 0.33 0.25
Core i3-7020U/2300 n/a n/a n/a n/a n/a n/a 0.79 0.94 0.75 0.38 0.37 0.29
Core i3-2120/3300 n/a n/a n/a n/a n/a n/a 0.77 0.86 0.68 0.36 0.33 0.30
Ryzen 5 3500U/2100 n/a n/a n/a n/a n/a n/a 1.18 1.10 1.04 0.46 0.44 0.32
Core i5-3210m/2500 n/a n/a n/a n/a n/a n/a 0.81 0.96 0.75 0.40 0.38 0.35
Pentium E5400/2700 0.96 0.93 1.01 1.61 0.80 0.40 0.82 1.30 0.78 0.42 0.40 0.36
Xeon E7-4870/2400/VMWare n/a n/a n/a n/a n/a n/a 1.00 1.47 0.97 0.47 0.44 0.36
Core2Duo T8100/2100 1.17 1.19 1.27 1.95 0.97 0.50 0.99 1.54 0.95 0.52 0.48 0.42
Core2Duo E6550/2330 1.12 1.09 1.18 1.88 0.92 0.44 1.14 1.58 0.94 0.52 0.47 0.43
Pentium T4500/2300 1.16 1.12 1.19 1.90 0.94 0.47 0.99 1.53 0.93 0.50 0.48 0.43
Xeon E5450/3000/VMWare 1.12 1.13 1.27 1.99 1.00 0.51 0.96 1.63 1.01 0.51 0.48 0.44
Pentium N4200/1100 n/a n/a n/a n/a n/a n/a 0.99 1.56 0.94 0.56 0.49 0.44
Athlon 64/3800+/2400 2.53 1.50 2.91 3.42 1.71 0.48 1.24 1.86 1.25 0.56 0.49 0.47
Core Duo T2600/2160 1.36 1.27 1.42 2.15 1.18 0.51 1.28 1.81 1.16 0.57 0.51 0.48
Athlon 64/3200+/2000 2.55 1.57 3.11 3.58 1.77 0.48 1.31 1.97 1.32 0.58 0.51 0.49
Pentium B950/2100 n/a n/a n/a n/a n/a n/a 1.19 1.35 1.07 0.56 0.53 0.49
Core2Duo E6300/1870 1.35 1.35 1.44 2.30 1.13 0.52 1.20 1.85 1.14 0.62 0.58 0.50
Athlon 64X2/4200+/2200 n/a n/a n/a n/a n/a n/a 1.37 2.04 1.38 0.62 0.55 0.53
P4-630/3000/800 2.19 1.07 2.82 2.83 1.14 0.58 1.14 1.55 0.90 0.59 0.57 0.53
Athlon 64X2/3800+/2000 3.00 1.80 3.52 4.02 2.04 0.59 1.52 2.24 1.53 0.69 0.60 0.58
Celeron 420/1600 1.60 1.60 1.70 2.71 1.33 0.64 1.41 2.18 1.34 0.72 0.66 0.58
P4/2400/533 3.59 1.09 4.67 4.78 1.07 0.61 1.21 1.72 0.98 0.63 0.67 0.61
Celeron/2400 3.61 1.10 4.71 4.78 1.07 0.62 1.21 1.74 0.99 0.64 0.67 0.61
Athlon XP/2000+/1667 4.11 2.15 4.59 4.85 2.50 0.84 1.79 2.47 1.81 1.15 0.71 0.69
Celeron/2000 4.30 1.31 5.59 5.71 1.28 0.73 1.43 2.06 1.18 0.75 0.80 0.75
Atom Z3740/1330 3.45 2.59 4.26 4.56 2.80 0.88 1.96 2.69 1.96 0.88 0.83 0.76
Celeron SU2300/1200 2.20 2.15 2.26 3.55 1.81 0.91 1.87 2.93 1.79 0.96 0.93 0.82
P4/1600 5.54 1.75 7.59 7.72 1.85 1.02 1.90 2.58 1.53 0.96 1.08 0.92
Atom N270/1600 10.81 7.22 18.73 18.84 10.06 2.42 2.19 4.23 1.72 1.48 1.33 1.19
PIII/1000 3.47 2.36 3.93 5.07 2.40 1.16 2.81 8.23 2.36 1.44 1.31 1.26
Celeron/6672) 7.00 4.80 8.30 9.30 4.80 2.60 5.70 17.90 6.10 n/a n/a 3.50
PII/350 9.99 6.78 11.31 14.40 6.86 3.35 8.09 23.77 6.80 4.12 3.77 3.64
Celeron/350(266) 10.11 6.85 11.39 14.83 6.94 3.42 8.38 24.15 7.02 4.36 4.00 3.87
K6/200 19.68 11.96 22.59 23.64 10.70 5.19 17.48 25.74 10.87 6.38 6.01 4.76
P/133 33.70 21.50 37.40 44.80 22.50 12.90 n/a n/a n/a n/a n/a n/a
Am486DX2/66 115.80 67.50 137.60 151.20 68.80 43.10 102.10 115.10 65.30 44.20 45.30 38.00
i386DX/33 629.00 347.80 589.00 660.70 357.00 206.40 n/a n/a n/a n/a n/a n/a
Am386SX/33/ramdrive 843.48 495.87 818.87 1127.80 507.78 282.18 n/a n/a n/a n/a n/a n/a
Am386SX/33/smartdrv 844.08 496.42 819.42 1219.59 513.56 283.78 n/a n/a n/a n/a n/a n/a
Am386SX/33/Win95 1106.76 519.60 858.03 933.89 811.021 296.30 1017.06 864.59 700.08 378.33 386.34 310.65
Am386SX/33 1173.23 497.23 1156.04 888.57 775.91 308.33 n/a n/a n/a n/a n/a n/a
Am286/16/smartdrv 1569.29 890.88 1509.95 1605.10 906.87 485.82 n/a n/a n/a n/a n/a n/a
Am386SX/16/smartdrv 2162.93 1020.03 1683.54 1831.64 1584.28 578.21 n/a n/a n/a n/a n/a n/a
286/123) 2568.40 1479.30 2661.30 2766.40 1489.20 805.90 n/a n/a n/a n/a n/a n/a
Am286/8/smartdrv 3126.43 1775.72 2998.99 3183.01 1804.45 972.95 n/a n/a n/a n/a n/a n/a
V30/10 4493.30 2757.13 4533.12 4656.45 2633.26 1298.03 n/a n/a n/a n/a n/a n/a
8086/9.54 5936.70 3503.50 6072.10 6348.60 3825.80 1757.60 n/a n/a n/a n/a n/a n/a
V30/4.77 n/a n/a n/a n/a n/a 2761.19 n/a n/a n/a n/a n/a n/a
8086/4.77 n/a n/a n/a n/a n/a 3528.40 n/a n/a n/a n/a n/a n/a

Nim game solving (cputest.ctx)

Solving part of test program are shown below:

define nLine 3 define nMax 3 int Line[nLine]; int Move(int Player; int @L, @Q) int M=0; // Number of lines int N=0; // Number of coins int K=0; int S; while K<nLine do if Line[K]>0 then S=K; N=N+Line[K]; inc M; end inc K; end if M>1 | N>1 then K=0; while K<nLine do N=1; while TRUE do if N>nMax then exit end if N>Line[K] then exit end Line[K]=Line[K]-N; int R=Move(-Player,@L,@Q); Line[K]=Line[K]+N; if R=Player then L=K; Q=N; return Player; end inc N; end inc K; end end L=S; Q=1; return -Player; end

Parameters L and Q are used to return move info. Using global variables can reduce working time by about 10 precent.

First move choice in Nim game with nine, eight and seven coins in three rows, seconds:

CPU\Compiler 050 101 130 TP1 TP3 BP7 BC3 140 205 212 213 BC5 VC4
Core i3-10105/3700 n/a n/a n/a n/a n/a n/a n/a 0.33 0.34 0.27 0.21 0.18 0.12
Core i5-7600/3500/VMWare 1.31 1.43 0.74 1.67 1.54 0.87 0.43 0.34 0.33 0.27 0.19 0.16 0.13
Xeon E3-1245 V6/3700/VMWare n/a n/a n/a n/a n/a n/a n/a 0.34 0.34 0.27 0.19 0.16 0.13
Core i5-4690S/3200/VMWare4) 3.79 1.63 0.82 1.92 1.70 0.90 0.48 0.37 0.41 0.30 0.21 0.16 0.14
Core i5-4690S/3200/Wine 1.75 1.93 0.97 2.25 1.98 1.06 0.58 0.37 0.40 0.30 0.21 0.21 0.15
Core i5-10351/1000-3600 n/a n/a n/a n/a n/a n/a n/a 0.39 0.36 0.31 0.24 0.21 0.15
Core i5-7600/3500 n/a n/a n/a n/a n/a n/a n/a 0.41 0.36 0.31 0.22 0.19 0.16
Xeon Platinum 8280/2700/VMWare n/a n/a n/a n/a n/a n/a n/a 0.43 0.47 0.34 0.24 0.22 0.17
Core i5-7200U/2500 n/a n/a n/a n/a n/a n/a n/a 0.45 0.46 0.35 0.26 0.28 0.18
Core i5-8250U/1600/3400 n/a n/a n/a n/a n/a n/a n/a 0.46 0.53 0.38 0.29 0.27 0.19
Xeon E3-1220 V2/3100/VMWare n/a n/a n/a n/a n/a n/a n/a 0.44 0.51 0.37 0.30 0.22 0.20
Core i3-2100/3100 1.85 1.99 1.03 2.31 2.11 1.15 0.60 0.52 0.59 0.44 0.35 0.25 0.22
Ryzen 3 2200G/3500 n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a 0.25 n/a
Core i3-7020U/2300 n/a n/a n/a n/a n/a n/a n/a 0.61 0.62 0.48 0.36 0.30 0.25
Ryzen 3 2300U/2000 n/a n/a n/a n/a n/a n/a n/a 0.66 0.58 0.54 0.46 0.39 0.26
Core i3-2120/3300 n/a n/a n/a n/a n/a n/a n/a 0.59 0.65 0.48 0.41 0.32 0.28
Core i5-3210m/2500 n/a n/a n/a n/a n/a n/a n/a 0.55 0.61 0.48 0.49 0.31 0.29
Ryzen 5 3500U/2100 n/a n/a n/a n/a n/a n/a n/a 0.99 0.75 0.83 0.84 0.88 0.34
Pentium E5400/2700 1.47 1.40 1.22 2.50 1.61 1.40 0.78 0.94 0.99 0.88 0.70 0.53 0.43
Pentium B950/2100 n/a n/a n/a n/a n/a n/a n/a 0.87 0.96 0.75 0.60 0.46 0.42
Pentium N4200/1100 n/a n/a n/a n/a n/a n/a n/a 1.06 1.44 0.96 0.80 0.71 0.49
Xeon E7-4870/2400/VMWare n/a n/a n/a n/a n/a n/a n/a 1.04 0.05 0.85 0.63 0.50 0.51
Athlon 64/3800+/2400 2.66 2.84 2.06 4.00 2.64 2.02 0.92 1.34 1.46 1.28 0.82 0.59 0.52
Xeon E5450/3000/VMWare 1.83 1.57 1.43 3.07 2.03 1.79 0.96 1.09 1.16 0.99 0.86 0.64 0.53
Core2Duo T8100/2100 1.80 1.66 1.55 4.14 1.92 1.70 0.98 1.15 1.21 1.06 0.86 0.62 0.53
Pentium T4500/2300 1.71 1.59 1.42 3.65 1.91 1.67 0.93 1.12 1.21 1.21 1.17 0.67 0.56
Athlon 64X2/4200+/2200 n/a n/a n/a n/a n/a n/a n/a 1.48 1.60 1.39 0.91 0.66 0.57
Core Duo T2600/2160 2.12 1.90 1.57 3.09 2.18 1.68 0.99 1.40 1.43 1.19 1.02 0.74 0.57
Athlon 64/3200+/2000 3.20 3.42 2.23 4.83 3.14 2.43 1.10 1.66 1.76 1.53 0.99 0.70 0.62
Core2Duo E6550/2330 1.66 1.55 1.49 3.16 2.04 1.61 0.94 1.34 1.30 1.20 1.01 0.72 0.62
Athlon 64X2/3800+/2000 3.18 3.40 2.41 4.82 3.08 2.41 1.10 1.62 1.76 1.54 1.00 0.72 0.64
Core2Duo E6300/1870 2.04 1.88 1.75 4.40 2.33 2.04 1.17 1.40 1.48 1.31 1.09 0.78 0.64
P4-630/3000/800 2.60 2.69 2.10 16.94 3.26 1.94 1.24 1.27 1.40 1.06 0.86 0.74 0.69
P4/2400/533 3.70 4.10 2.50 15.70 4.90 2.60 1.50 1.30 1.40 1.10 0.91 n/a 0.70
Celeron/2400 3.60 4.10 2.50 13.10 5.00 2.60 1.50 1.30 1.40 1.10 0.93 n/a 0.70
Celeron 420/1600 2.40 2.20 2.09 4.56 2.65 2.32 1.31 1.63 1.71 1.52 1.28 0.91 0.74
Athlon XP/2000+/1667 5.20 4.40 2.70 5.90 4.00 3.00 1.40 1.99 2.14 1.82 1.22 0.96 0.88
Celeron/2000 4.40 4.90 2.90 18.80 5.90 3.10 1.80 1.50 1.70 1.30 1.09 0.95 0.90
Celeron SU2300/1200 3.26 3.04 2.79 6.56 3.58 3.15 1.77 2.08 2.26 1.96 1.58 1.20 0.98
Atom Z3740/1330 4.60 4.56 3.33 6.56 5.34 3.92 2.14 1.86 2.75 1.75 1.31 1.26 1.04
P4/1600 5.81 6.63 3.91 8.09 7.53 4.05 2.27 2.14 2.37 1.74 1.54 1.25 1.12
Athlon XP-M/1600+/1400 6.20 5.30 3.40 7.00 4.70 3.50 1.60 2.30 2.60 2.20 n/a n/a 1.30
Celeron/1400 3.90 3.80 2.70 6.00 3.80 2.70 1.80 n/a n/a n/a n/a n/a n/a
Atom N270/1600 14.17 14.05 13.38 28.78 22.45 17.22 11.40 2.65 3.61 2.37 1.77 1.54 1.42
PIII/1000 5.50 5.30 3.80 8.10 5.20 3.70 2.40 n/a n/a n/a n/a n/a n/a
Celeron/1000 10.30 5.30 4.10 8.10 5.20 3.80 2.40 n/a n/a n/a n/a n/a n/a
P4/1500 6.30 7.10 4.20 32.70 8.10 4.30 2.40 n/a n/a n/a n/a n/a n/a
Athlon/900 9.60 8.20 5.50 10.90 7.20 5.50 2.50 n/a n/a 3.00 n/a n/a 1.60
Celeron/667 15.40 8.00 6.00 12.10 7.70 5.70 3.70 5.40 5.30 4.60 n/a n/a 2.60
Celeron/433 23.70 12.20 9.20 18.70 11.80 8.70 5.70 n/a n/a n/a n/a n/a n/a
K6/300 21.20 18.90 11.00 19.60 15.50 10.50 6.90 n/a n/a n/a n/a n/a n/a
PII/350 29.40 15.30 11.50 23.20 14.60 10.80 6.90 9.90 9.90 7.90 6.39 n/a 4.80
Celeron/266 38.60 20.10 15.10 30.30 19.20 14.20 9.20 n/a n/a n/a n/a n/a n/a
PII/233 43.20 22.50 16.90 33.90 21.40 15.90 10.20 n/a n/a n/a n/a n/a n/a
K6/200 49.00 28.60 19.10 29.20 23.60 16.00 10.30 17.20 16.80 14.40 10.30 7.09 6.50
P/200MMX2) 30.70 29.10 18.60 47.20 26.50 17.40 11.20 n/a n/a n/a n/a n/a n/a
MII-PR233/187 60.20 31.10 20.10 34.50 27.50 18.60 12.80 n/a n/a n/a n/a n/a n/a
P/133 102.50 50.60 33.00 73.30 44.20 32.70 18.90 35.00 40.70 33.70 n/a n/a 13.00
Am486DX2/66 293.00 158.90 108.30 204.20 136.20 104.90 57.50 108.10 130.80 100.00 76.50 n/a 52.10
Am386DX/40 922.50 563.00 378.00 736.60 490.40 326.10 204.90 n/a n/a n/a n/a n/a n/a
i386/33 779.60 725.90 455.50 910.80 639.70 431.80 272.50 n/a n/a n/a n/a n/a n/a
Am386SX/33/ramdrive 1421.14 1361.54 995.58 1443.00 783.38 906.04 388.92 n/a n/a n/a n/a n/a n/a
Am386SX/33/smartdrv 1190.97 1131.87 843.86 1441.13 1185.26 856.11 388.92 n/a n/a n/a n/a n/a n/a
Am386SX/33/Win954) 1769.90 1190.75 909.56 1509.25 1241.46 913.40 407.48 958.01 953.29 861.95 700.91 475.71 432.86
Am386SX/33 1438.11 1361.59 995.58 1260.24 783.44 906.04 541.24 n/a n/a n/a n/a n/a n/a
Am286/16/smartdrv4) 2999.71 1784.29 1181.64 1983.31 1611.86 1080.23 682.31 n/a n/a n/a n/a n/a n/a
Am386SX/16/smartdrv4) 3388.02 2319.54 1727.55 2947.08 2434.52 1747.71 797.77 n/a n/a n/a n/a n/a n/a
286/123) 3870.90 2317.00 1655.00 2688.70 2101.70 1415.60 885.00 n/a n/a n/a n/a n/a n/a
Am286/8/smartdrv4) 5930.31 3560.78 2356.13 3951.12 3207.51 2155.24 1282.54 n/a n/a n/a n/a n/a n/a
V30/10 n/a 5124.85 3626.92 5819.18 4618.652 3266.730 2026.37 n/a n/a n/a n/a n/a n/a
8086/9.54 7020.60 6608.60 4597.70 7670.90 6221.20 4518.60 2684.80 n/a n/a n/a n/a n/a n/a
V30/4.77 n/a n/a n/a n/a n/a n/a 4258.63 n/a n/a n/a n/a n/a n/a
8086/4.77 n/a n/a n/a n/a n/a n/a 5372.60 n/a n/a n/a n/a n/a n/a

1) - Results significally depends on screen mode (in window faster then on full screen).

2) - Test code contains some unnecessary commands.

3) - Interpolation from 16 MHz to 12 MHz.

4) - Context 0.5 result. Due to an error, in all other cases the result shown is one of the earlier versions of Context 1.0.

Data shown in previous tables can be converted to relative processor efficiency (8086/4.77MHz = 1):

Processor Compilation
(ctx->bin)
Compilation
(ctx->asm)
Compression Nim game
Core i5/32bit n/a 29.1 32.9 53.4
Core i3/32bit n/a 30.0 21.7 37.6
Elbrus-8S1) n/a n/a 18.0 27.0
Pentium E/32bit n/a 26.5 17.3 22.1
Core2Duo/32bit n/a 7.7 18.0 21.4
CoreDuo/32bit n/a 17.2 16.2 20.8
Athlon 64/32bit n/a 10.3 17.9 20.0
K6/32bit n/a 14.1 17.7 19.7
STM32F1031) n/a n/a n/a 18.4
Athlon XP/32bit n/a 10.0 14.6 17.5
Pentium II/32bit n/a 14.3 13.2 15.3
Pentium III/32bit n/a 13.1 13.4 14.8
Pentium/32bit n/a 10.1 n/a 14.8
Core i5/16bit 6.2 7.1 21.0 13.8
Core i3/16bit 2.4 3.7 19.4 13.8
K6/16bit 9.9 10.6 16.2 12.4
Pentium 4/32bit n/a 9.9 11.5 12.4
Pentium E/16bit 3.1 7.5 15.6 12.2
CoreDuo/16bit 5.2 8.8 15.3 12.0
Core2Duo/16bit 4.1 7.2 17.3 11.7
Athlon 64/16bit 4.2 8.6 14.3 11.6
Athlon/16bit 5.0 n/a n/a 11.4
Atom/32bit n/a 6.5 8.8 11.3
Athlon XP/16bit 3.6 5.4 12.0 11.0
Pentium II/16bit 7.3 8.9 14.4 10.8
M II/16bit 7.3 n/a n/a 10.7
Pentium III/16bit 5.9 6.7 14.5 10.4
Pentium/16bit 8.4 8.4 9.8 10.2
Am486DX2/32bit n/a 6.1 5.9 7.5
Pentium 4/16bit 4.6 5.5 11.5 7.1
ATmega328P-PU1) n/a n/a n/a 6.9
Am486DX2/16bit 4.4 5.4 5.9 6.8
Am386DX/16bit 2.7 n/a n/a 3.1
i386/16bit 2.5 2.7 2.5 2.8
286 2.0 2.0 1.7 2.4
Am386SX/16bit 1.7 1.7 1.8 2.0
Atom/16bit 1.2 1.6 1.0 1.4
V30 1.3 1.3 1.3 1.3
8086 1.0 1.0 1.0 1.0

1) - Based on gcc results.

Top.Mail.Ru
Сайт создан в системе uCoz