In order to investigate some issues with the use of the -O2 C compiler option I have measured the system's performance when built with -O1 and -O2, and with --enable-multiple-hosts and --enable-single-host, and with all 65 releases of gcc since version 2.95 .
The machine I used is a x86_64 linux machine with 48 GB of RAM, but in order to compile the early releases of gcc and to be able to compare all versions of gcc, I have compiled 32 bit executables of gcc and Gambit (so at most 4 GB of RAM is used by the processes). The most recent Gambit was used (including the new --enable-c-opt configure option).
To measure the performance of the resulting system, I have executed the gsi interpreter on a moderately complex program (tests/mix.scm). I also measured the elapsed time for building Gambit sequentially (i.e. a simple "make" after the appropriate "./configure ..."). Both the absolute time in seconds and the time relative to the smallest time is indicated. The tables are given below.
A few interesting facts:
1) The fastest execution is when Gambit is built with gcc 3.3.2 using "./configure --enable-single-host --enable-c-opt=-O2". Recent versions of gcc (>= 4.6.1) are within 3% of the fastest execution.
2) Using --enable-single-host causes a fairly consistent factor of 2 improvement in execution speed over using the default (multiple hosts).
3) Typically, there is very little difference in execution speed between using -O1 and -O2. -O2 is very often faster, but not always and typically by only a few percent.
4) When using gcc 4.6.0 the combination of --enable-single-host and --enable-c-opt=-O2 creates a faulty interpreter (the problem seems to be related to memory deallocation when gsi terminates: *** glibc detected *** gsi: free(): invalid pointer: 0x08e694a5 ***). This is probably a bug in gcc 4.6.0 .
5) The fastest build, half a minute, is when Gambit is built with gcc 2.95.3 using a plain "./configure". For versions of gcc >= 4.2.0, adding --enable-single-host increases the build time by at most 25%, and the additional use of -O2 increases the build time by a factor of 2 to 3. The longest build time is 6 minutes.
I believe these facts are a good justification for using -O1 as the default. With -O2, the build time is considerably longer, the execution time of the interpreter is marginally better, and for gcc 4.6.0 the interpreter executable is faulty.
Marc
**** Execution time of tests/mix.scm when run by gsi
| --enable-multiple-hosts | --enable-single-host | | -O1 | -O2 | -O1 | -O2 | gcc | secs rel | secs rel | secs rel | secs rel | -------+----------------+----------------+----------------+----------------+ 2.95 | 5.34 ( 2.03) | 5.30 ( 2.01) | 2.97 ( 1.13) | 2.90 ( 1.10) | -------+----------------+----------------+----------------+----------------+ 2.95.1 | 5.38 ( 2.04) | 5.43 ( 2.06) | 2.97 ( 1.13) | 2.90 ( 1.10) | -------+----------------+----------------+----------------+----------------+ 2.95.2 | 5.32 ( 2.02) | 5.46 ( 2.07) | 2.97 ( 1.13) | 2.87 ( 1.09) | -------+----------------+----------------+----------------+----------------+ 2.95.3 | 5.31 ( 2.02) | 5.40 ( 2.05) | 2.87 ( 1.09) | 3.04 ( 1.15) | -------+----------------+----------------+----------------+----------------+ 3.0 | 5.44 ( 2.06) | 5.31 ( 2.02) | 3.01 ( 1.14) | 3.30 ( 1.25) | -------+----------------+----------------+----------------+----------------+ 3.0.1 | 5.42 ( 2.06) | 5.37 ( 2.04) | 2.95 ( 1.12) | 2.88 ( 1.09) | -------+----------------+----------------+----------------+----------------+ 3.0.2 | 5.53 ( 2.10) | 5.37 ( 2.04) | 2.95 ( 1.12) | 2.89 ( 1.10) | -------+----------------+----------------+----------------+----------------+ 3.0.3 | 5.41 ( 2.05) | 6.06 ( 2.30) | 2.91 ( 1.10) | 2.92 ( 1.11) | -------+----------------+----------------+----------------+----------------+ 3.0.4 | 5.50 ( 2.09) | 5.41 ( 2.05) | 2.93 ( 1.11) | 2.84 ( 1.08) | -------+----------------+----------------+----------------+----------------+ 3.1 | 5.49 ( 2.08) | 5.48 ( 2.08) | 2.96 ( 1.13) | 2.98 ( 1.13) | -------+----------------+----------------+----------------+----------------+ 3.1.1 | 5.49 ( 2.09) | 5.89 ( 2.24) | 3.04 ( 1.15) | 3.00 ( 1.14) | -------+----------------+----------------+----------------+----------------+ 3.2 | 5.44 ( 2.06) | 5.51 ( 2.09) | 3.03 ( 1.15) | 3.00 ( 1.14) | -------+----------------+----------------+----------------+----------------+ 3.2.1 | 5.60 ( 2.13) | 5.66 ( 2.15) | 3.05 ( 1.16) | 3.05 ( 1.16) | -------+----------------+----------------+----------------+----------------+ 3.2.2 | 5.63 ( 2.14) | 5.66 ( 2.15) | 2.94 ( 1.12) | 3.05 ( 1.16) | -------+----------------+----------------+----------------+----------------+ 3.2.3 | 5.45 ( 2.07) | 5.61 ( 2.13) | 3.03 ( 1.15) | 3.09 ( 1.17) | -------+----------------+----------------+----------------+----------------+ 3.3 | 5.35 ( 2.03) | 5.26 ( 2.00) | 2.93 ( 1.11) | 2.67 ( 1.01) | -------+----------------+----------------+----------------+----------------+ 3.3.1 | 5.36 ( 2.03) | 5.28 ( 2.00) | 2.90 ( 1.10) | 2.66 ( 1.01) | -------+----------------+----------------+----------------+----------------+ 3.3.2 | 5.35 ( 2.03) | 5.37 ( 2.04) | 3.31 ( 1.26) | 2.63 ( 1.00) | -------+----------------+----------------+----------------+----------------+ 3.3.3 | 5.35 ( 2.03) | 5.30 ( 2.01) | 2.90 ( 1.10) | 2.64 ( 1.00) | -------+----------------+----------------+----------------+----------------+ 3.3.4 | 5.20 ( 1.98) | 5.31 ( 2.02) | 2.83 ( 1.08) | 2.69 ( 1.02) | -------+----------------+----------------+----------------+----------------+ 3.3.5 | 5.21 ( 1.98) | 5.53 ( 2.10) | 2.83 ( 1.08) | 2.69 ( 1.02) | -------+----------------+----------------+----------------+----------------+ 3.3.6 | 5.30 ( 2.01) | 5.25 ( 1.99) | 3.20 ( 1.21) | 2.69 ( 1.02) | -------+----------------+----------------+----------------+----------------+ 3.4.0 | 5.47 ( 2.08) | 5.37 ( 2.04) | 2.87 ( 1.09) | 2.86 ( 1.08) | -------+----------------+----------------+----------------+----------------+ 3.4.1 | 5.54 ( 2.10) | 5.40 ( 2.05) | 2.82 ( 1.07) | 2.90 ( 1.10) | -------+----------------+----------------+----------------+----------------+ 3.4.2 | 5.41 ( 2.05) | 5.41 ( 2.05) | 2.81 ( 1.07) | 2.91 ( 1.10) | -------+----------------+----------------+----------------+----------------+ 3.4.3 | 5.41 ( 2.05) | 5.44 ( 2.06) | 2.85 ( 1.08) | 2.91 ( 1.10) | -------+----------------+----------------+----------------+----------------+ 3.4.4 | 5.63 ( 2.14) | 5.41 ( 2.06) | 2.89 ( 1.10) | 2.88 ( 1.09) | -------+----------------+----------------+----------------+----------------+ 3.4.5 | 5.63 ( 2.14) | 5.38 ( 2.04) | 2.89 ( 1.10) | 2.81 ( 1.07) | -------+----------------+----------------+----------------+----------------+ 3.4.6 | 5.66 ( 2.15) | 6.51 ( 2.47) | 3.08 ( 1.17) | 2.80 ( 1.06) | -------+----------------+----------------+----------------+----------------+ 4.0.0 | 5.38 ( 2.04) | 5.24 ( 1.99) | 2.95 ( 1.12) | 3.01 ( 1.14) | -------+----------------+----------------+----------------+----------------+ 4.0.1 | 5.38 ( 2.04) | 5.25 ( 1.99) | 2.95 ( 1.12) | 3.01 ( 1.14) | -------+----------------+----------------+----------------+----------------+ 4.0.2 | 5.49 ( 2.09) | 5.26 ( 2.00) | 2.96 ( 1.12) | 2.98 ( 1.13) | -------+----------------+----------------+----------------+----------------+ 4.0.3 | 5.40 ( 2.05) | 5.22 ( 1.98) | 2.98 ( 1.13) | 2.98 ( 1.13) | -------+----------------+----------------+----------------+----------------+ 4.0.4 | 5.38 ( 2.04) | 5.22 ( 1.98) | 2.96 ( 1.12) | 2.97 ( 1.13) | -------+----------------+----------------+----------------+----------------+ 4.1.0 | 5.52 ( 2.10) | 5.35 ( 2.03) | 3.14 ( 1.19) | 2.81 ( 1.07) | -------+----------------+----------------+----------------+----------------+ 4.1.1 | 5.55 ( 2.11) | 5.32 ( 2.02) | 3.17 ( 1.20) | 2.84 ( 1.08) | -------+----------------+----------------+----------------+----------------+ 4.1.2 | 5.51 ( 2.09) | 5.28 ( 2.00) | 2.91 ( 1.11) | 2.88 ( 1.09) | -------+----------------+----------------+----------------+----------------+ 4.2.0 | 5.44 ( 2.06) | 5.33 ( 2.02) | 3.02 ( 1.14) | 2.81 ( 1.07) | -------+----------------+----------------+----------------+----------------+ 4.2.1 | 5.46 ( 2.07) | 5.28 ( 2.01) | 3.02 ( 1.14) | 2.81 ( 1.07) | -------+----------------+----------------+----------------+----------------+ 4.2.2 | 5.45 ( 2.07) | 5.29 ( 2.01) | 3.02 ( 1.15) | 2.81 ( 1.07) | -------+----------------+----------------+----------------+----------------+ 4.2.3 | 5.44 ( 2.07) | 5.28 ( 2.01) | 3.02 ( 1.15) | 2.81 ( 1.07) | -------+----------------+----------------+----------------+----------------+ 4.2.4 | 5.53 ( 2.10) | 5.29 ( 2.01) | 3.08 ( 1.17) | 2.81 ( 1.07) | -------+----------------+----------------+----------------+----------------+ 4.3.0 | 5.71 ( 2.17) | 5.42 ( 2.06) | 3.36 ( 1.28) | 3.52 ( 1.34) | -------+----------------+----------------+----------------+----------------+ 4.3.1 | 5.71 ( 2.17) | 5.42 ( 2.06) | 3.36 ( 1.28) | 3.52 ( 1.33) | -------+----------------+----------------+----------------+----------------+ 4.3.2 | 5.50 ( 2.09) | 5.35 ( 2.03) | 3.36 ( 1.28) | 3.50 ( 1.33) | -------+----------------+----------------+----------------+----------------+ 4.3.3 | 5.50 ( 2.09) | 5.44 ( 2.07) | 3.36 ( 1.27) | 3.48 ( 1.32) | -------+----------------+----------------+----------------+----------------+ 4.3.4 | 5.57 ( 2.11) | 5.47 ( 2.08) | 3.33 ( 1.27) | 3.50 ( 1.33) | -------+----------------+----------------+----------------+----------------+ 4.3.5 | 5.56 ( 2.11) | 5.46 ( 2.07) | 3.35 ( 1.27) | 3.49 ( 1.33) | -------+----------------+----------------+----------------+----------------+ 4.3.6 | 5.56 ( 2.11) | 5.46 ( 2.07) | 3.34 ( 1.27) | 3.49 ( 1.33) | -------+----------------+----------------+----------------+----------------+ 4.4.0 | 5.71 ( 2.17) | 5.48 ( 2.08) | 3.18 ( 1.21) | 2.91 ( 1.11) | -------+----------------+----------------+----------------+----------------+ 4.4.1 | 5.79 ( 2.20) | 5.45 ( 2.07) | 3.01 ( 1.14) | 2.94 ( 1.12) | -------+----------------+----------------+----------------+----------------+ 4.4.2 | 5.78 ( 2.20) | 5.38 ( 2.04) | 3.01 ( 1.14) | 2.98 ( 1.13) | -------+----------------+----------------+----------------+----------------+ 4.4.3 | 5.82 ( 2.21) | 5.37 ( 2.04) | 3.01 ( 1.14) | 2.84 ( 1.08) | -------+----------------+----------------+----------------+----------------+ 4.4.4 | 5.76 ( 2.19) | 5.36 ( 2.04) | 2.95 ( 1.12) | 2.99 ( 1.14) | -------+----------------+----------------+----------------+----------------+ 4.4.5 | 5.76 ( 2.19) | 5.33 ( 2.02) | 2.91 ( 1.11) | 2.89 ( 1.10) | -------+----------------+----------------+----------------+----------------+ 4.4.6 | 5.76 ( 2.19) | 5.45 ( 2.07) | 2.91 ( 1.10) | 2.92 ( 1.11) | -------+----------------+----------------+----------------+----------------+ 4.4.7 | 5.76 ( 2.19) | 5.45 ( 2.07) | 2.91 ( 1.10) | 2.92 ( 1.11) | -------+----------------+----------------+----------------+----------------+ 4.5.0 | 5.40 ( 2.05) | 5.30 ( 2.01) | 2.95 ( 1.12) | 2.77 ( 1.05) | -------+----------------+----------------+----------------+----------------+ 4.5.1 | 5.36 ( 2.03) | 5.42 ( 2.06) | 2.87 ( 1.09) | 2.83 ( 1.08) | -------+----------------+----------------+----------------+----------------+ 4.5.2 | 5.36 ( 2.03) | 5.42 ( 2.06) | 2.85 ( 1.08) | 2.86 ( 1.08) | -------+----------------+----------------+----------------+----------------+ 4.5.3 | 5.36 ( 2.04) | 5.24 ( 1.99) | 2.85 ( 1.08) | 2.86 ( 1.09) | -------+----------------+----------------+----------------+----------------+ 4.6.0 | 5.33 ( 2.02) | crash | 2.84 ( 1.08) | crash | -------+----------------+----------------+----------------+----------------+ 4.6.1 | 5.31 ( 2.02) | 5.06 ( 1.92) | 2.85 ( 1.08) | 2.68 ( 1.02) | -------+----------------+----------------+----------------+----------------+ 4.6.2 | 5.30 ( 2.01) | 5.13 ( 1.95) | 2.87 ( 1.09) | 2.70 ( 1.02) | -------+----------------+----------------+----------------+----------------+ 4.6.3 | 5.30 ( 2.01) | 5.13 ( 1.95) | 2.87 ( 1.09) | 2.70 ( 1.03) | -------+----------------+----------------+----------------+----------------+ 4.7.0 | 5.22 ( 1.98) | 4.95 ( 1.88) | 2.89 ( 1.10) | 2.70 ( 1.03) | -------+----------------+----------------+----------------+----------------+
**** Elapsed time of "make"
| --enable-multiple-hosts | --enable-single-host | | -O1 | -O2 | -O1 | -O2 | gcc | secs rel | secs rel | secs rel | secs rel | -------+----------------+----------------+----------------+----------------+ 2.95 | 34.00 ( 1.03) | 42.49 ( 1.28) | 58.29 ( 1.76) | 91.51 ( 2.76) | -------+----------------+----------------+----------------+----------------+ 2.95.1 | 33.89 ( 1.02) | 41.82 ( 1.26) | 56.38 ( 1.70) | 90.78 ( 2.74) | -------+----------------+----------------+----------------+----------------+ 2.95.2 | 33.83 ( 1.02) | 42.66 ( 1.29) | 56.88 ( 1.72) | 91.69 ( 2.77) | -------+----------------+----------------+----------------+----------------+ 2.95.3 | 33.15 ( 1.00) | 40.89 ( 1.23) | 56.19 ( 1.70) | 93.00 ( 2.81) | -------+----------------+----------------+----------------+----------------+ 3.0 | 43.63 ( 1.32) | 63.58 ( 1.92) | 98.37 ( 2.97) | 198.97 ( 6.00) | -------+----------------+----------------+----------------+----------------+ 3.0.1 | 43.30 ( 1.31) | 64.00 ( 1.93) | 99.07 ( 2.99) | 181.10 ( 5.46) | -------+----------------+----------------+----------------+----------------+ 3.0.2 | 42.38 ( 1.28) | 65.59 ( 1.98) | 95.82 ( 2.89) | 183.37 ( 5.53) | -------+----------------+----------------+----------------+----------------+ 3.0.3 | 44.93 ( 1.36) | 64.64 ( 1.95) | 98.70 ( 2.98) | 179.34 ( 5.41) | -------+----------------+----------------+----------------+----------------+ 3.0.4 | 44.30 ( 1.34) | 64.80 ( 1.95) | 98.90 ( 2.98) | 178.63 ( 5.39) | -------+----------------+----------------+----------------+----------------+ 3.1 | 49.02 ( 1.48) | 79.16 ( 2.39) | 132.62 ( 4.00) | 385.21 (11.62) | -------+----------------+----------------+----------------+----------------+ 3.1.1 | 48.77 ( 1.47) | 79.45 ( 2.40) | 133.49 ( 4.03) | 375.01 (11.31) | -------+----------------+----------------+----------------+----------------+ 3.2 | 49.68 ( 1.50) | 78.50 ( 2.37) | 130.94 ( 3.95) | 402.10 (12.13) | -------+----------------+----------------+----------------+----------------+ 3.2.1 | 49.37 ( 1.49) | 78.03 ( 2.35) | 130.90 ( 3.95) | 366.79 (11.06) | -------+----------------+----------------+----------------+----------------+ 3.2.2 | 49.36 ( 1.49) | 78.06 ( 2.35) | 131.08 ( 3.95) | 364.01 (10.98) | -------+----------------+----------------+----------------+----------------+ 3.2.3 | 49.93 ( 1.51) | 77.75 ( 2.35) | 131.50 ( 3.97) | 366.83 (11.07) | -------+----------------+----------------+----------------+----------------+ 3.3 | 50.08 ( 1.51) | 76.42 ( 2.31) | 89.80 ( 2.71) | 292.12 ( 8.81) | -------+----------------+----------------+----------------+----------------+ 3.3.1 | 50.06 ( 1.51) | 77.01 ( 2.32) | 90.45 ( 2.73) | 292.13 ( 8.81) | -------+----------------+----------------+----------------+----------------+ 3.3.2 | 50.04 ( 1.51) | 76.34 ( 2.30) | 89.63 ( 2.70) | 290.08 ( 8.75) | -------+----------------+----------------+----------------+----------------+ 3.3.3 | 50.25 ( 1.52) | 76.82 ( 2.32) | 90.44 ( 2.73) | 295.69 ( 8.92) | -------+----------------+----------------+----------------+----------------+ 3.3.4 | 50.23 ( 1.52) | 77.15 ( 2.33) | 90.71 ( 2.74) | 296.18 ( 8.93) | -------+----------------+----------------+----------------+----------------+ 3.3.5 | 50.18 ( 1.51) | 77.02 ( 2.32) | 90.11 ( 2.72) | 293.49 ( 8.85) | -------+----------------+----------------+----------------+----------------+ 3.3.6 | 50.23 ( 1.52) | 77.43 ( 2.34) | 90.60 ( 2.73) | 296.37 ( 8.94) | -------+----------------+----------------+----------------+----------------+ 3.4.0 | 50.68 ( 1.53) | 71.85 ( 2.17) | 47.80 ( 1.44) | 170.43 ( 5.14) | -------+----------------+----------------+----------------+----------------+ 3.4.1 | 47.50 ( 1.43) | 73.34 ( 2.21) | 48.74 ( 1.47) | 172.05 ( 5.19) | -------+----------------+----------------+----------------+----------------+ 3.4.2 | 47.48 ( 1.43) | 72.67 ( 2.19) | 48.10 ( 1.45) | 174.11 ( 5.25) | -------+----------------+----------------+----------------+----------------+ 3.4.3 | 47.42 ( 1.43) | 72.46 ( 2.19) | 48.03 ( 1.45) | 172.00 ( 5.19) | -------+----------------+----------------+----------------+----------------+ 3.4.4 | 47.97 ( 1.45) | 72.81 ( 2.20) | 47.82 ( 1.44) | 172.45 ( 5.20) | -------+----------------+----------------+----------------+----------------+ 3.4.5 | 47.92 ( 1.45) | 72.77 ( 2.20) | 47.79 ( 1.44) | 171.46 ( 5.17) | -------+----------------+----------------+----------------+----------------+ 3.4.6 | 48.18 ( 1.45) | 73.27 ( 2.21) | 47.97 ( 1.45) | 171.99 ( 5.19) | -------+----------------+----------------+----------------+----------------+ 4.0.0 | 64.86 ( 1.96) | 85.67 ( 2.58) | 105.44 ( 3.18) | 200.58 ( 6.05) | -------+----------------+----------------+----------------+----------------+ 4.0.1 | 63.44 ( 1.91) | 85.37 ( 2.58) | 107.23 ( 3.23) | 200.04 ( 6.03) | -------+----------------+----------------+----------------+----------------+ 4.0.2 | 63.66 ( 1.92) | 85.66 ( 2.58) | 105.26 ( 3.18) | 200.38 ( 6.04) | -------+----------------+----------------+----------------+----------------+ 4.0.3 | 63.47 ( 1.91) | 85.38 ( 2.58) | 107.57 ( 3.24) | 200.84 ( 6.06) | -------+----------------+----------------+----------------+----------------+ 4.0.4 | 63.42 ( 1.91) | 92.51 ( 2.79) | 105.24 ( 3.17) | 200.67 ( 6.05) | -------+----------------+----------------+----------------+----------------+ 4.1.0 | 69.72 ( 2.10) | 93.87 ( 2.83) | 121.59 ( 3.67) | 247.69 ( 7.47) | -------+----------------+----------------+----------------+----------------+ 4.1.1 | 68.43 ( 2.06) | 92.90 ( 2.80) | 102.04 ( 3.08) | 189.45 ( 5.71) | -------+----------------+----------------+----------------+----------------+ 4.1.2 | 69.15 ( 2.09) | 92.38 ( 2.79) | 103.45 ( 3.12) | 199.92 ( 6.03) | -------+----------------+----------------+----------------+----------------+ 4.2.0 | 79.05 ( 2.38) | 105.12 ( 3.17) | 83.46 ( 2.52) | 172.92 ( 5.22) | -------+----------------+----------------+----------------+----------------+ 4.2.1 | 81.37 ( 2.45) | 107.41 ( 3.24) | 84.23 ( 2.54) | 173.26 ( 5.23) | -------+----------------+----------------+----------------+----------------+ 4.2.2 | 81.42 ( 2.46) | 108.04 ( 3.26) | 84.44 ( 2.55) | 173.84 ( 5.24) | -------+----------------+----------------+----------------+----------------+ 4.2.3 | 81.44 ( 2.46) | 109.30 ( 3.30) | 84.29 ( 2.54) | 174.04 ( 5.25) | -------+----------------+----------------+----------------+----------------+ 4.2.4 | 81.36 ( 2.45) | 108.06 ( 3.26) | 84.18 ( 2.54) | 174.47 ( 5.26) | -------+----------------+----------------+----------------+----------------+ 4.3.0 | 74.37 ( 2.24) | 112.07 ( 3.38) | 80.64 ( 2.43) | 210.46 ( 6.35) | -------+----------------+----------------+----------------+----------------+ 4.3.1 | 73.96 ( 2.23) | 112.87 ( 3.40) | 80.33 ( 2.42) | 205.96 ( 6.21) | -------+----------------+----------------+----------------+----------------+ 4.3.2 | 73.93 ( 2.23) | 110.52 ( 3.33) | 78.91 ( 2.38) | 199.48 ( 6.02) | -------+----------------+----------------+----------------+----------------+ 4.3.3 | 73.86 ( 2.23) | 110.52 ( 3.33) | 79.60 ( 2.40) | 199.99 ( 6.03) | -------+----------------+----------------+----------------+----------------+ 4.3.4 | 74.29 ( 2.24) | 110.46 ( 3.33) | 81.02 ( 2.44) | 198.01 ( 5.97) | -------+----------------+----------------+----------------+----------------+ 4.3.5 | 73.42 ( 2.21) | 110.74 ( 3.34) | 79.37 ( 2.39) | 198.17 ( 5.98) | -------+----------------+----------------+----------------+----------------+ 4.3.6 | 74.01 ( 2.23) | 110.60 ( 3.34) | 80.03 ( 2.41) | 198.45 ( 5.99) | -------+----------------+----------------+----------------+----------------+ 4.4.0 | 79.38 ( 2.39) | 113.40 ( 3.42) | 89.70 ( 2.71) | 211.26 ( 6.37) | -------+----------------+----------------+----------------+----------------+ 4.4.1 | 78.12 ( 2.36) | 114.11 ( 3.44) | 88.92 ( 2.68) | 211.13 ( 6.37) | -------+----------------+----------------+----------------+----------------+ 4.4.2 | 79.46 ( 2.40) | 114.49 ( 3.45) | 90.39 ( 2.73) | 210.79 ( 6.36) | -------+----------------+----------------+----------------+----------------+ 4.4.3 | 77.76 ( 2.35) | 114.03 ( 3.44) | 88.46 ( 2.67) | 212.31 ( 6.40) | -------+----------------+----------------+----------------+----------------+ 4.4.4 | 77.75 ( 2.35) | 113.94 ( 3.44) | 89.19 ( 2.69) | 210.39 ( 6.35) | -------+----------------+----------------+----------------+----------------+ 4.4.5 | 78.32 ( 2.36) | 114.55 ( 3.46) | 88.20 ( 2.66) | 212.88 ( 6.42) | -------+----------------+----------------+----------------+----------------+ 4.4.6 | 78.24 ( 2.36) | 114.99 ( 3.47) | 89.99 ( 2.71) | 219.40 ( 6.62) | -------+----------------+----------------+----------------+----------------+ 4.4.7 | 77.71 ( 2.34) | 113.90 ( 3.44) | 87.86 ( 2.65) | 210.67 ( 6.36) | -------+----------------+----------------+----------------+----------------+ 4.5.0 | 78.36 ( 2.36) | 109.78 ( 3.31) | 96.15 ( 2.90) | 191.80 ( 5.79) | -------+----------------+----------------+----------------+----------------+ 4.5.1 | 78.23 ( 2.36) | 109.68 ( 3.31) | 95.36 ( 2.88) | 188.34 ( 5.68) | -------+----------------+----------------+----------------+----------------+ 4.5.2 | 78.45 ( 2.37) | 110.11 ( 3.32) | 96.61 ( 2.91) | 189.24 ( 5.71) | -------+----------------+----------------+----------------+----------------+ 4.5.3 | 79.87 ( 2.41) | 112.65 ( 3.40) | 98.45 ( 2.97) | 196.36 ( 5.92) | -------+----------------+----------------+----------------+----------------+ 4.6.0 | 82.61 ( 2.49) | 117.70 ( 3.55) | 102.63 ( 3.10) | 235.50 ( 7.10) | -------+----------------+----------------+----------------+----------------+ 4.6.1 | 81.98 ( 2.47) | 121.60 ( 3.67) | 103.07 ( 3.11) | 266.58 ( 8.04) | -------+----------------+----------------+----------------+----------------+ 4.6.2 | 81.67 ( 2.46) | 121.04 ( 3.65) | 103.30 ( 3.12) | 263.24 ( 7.94) | -------+----------------+----------------+----------------+----------------+ 4.6.3 | 82.22 ( 2.48) | 120.98 ( 3.65) | 102.90 ( 3.10) | 265.34 ( 8.00) | -------+----------------+----------------+----------------+----------------+ 4.7.0 | 92.20 ( 2.78) | 145.52 ( 4.39) | 108.40 ( 3.27) | 362.57 (10.94) | -------+----------------+----------------+----------------+----------------+
Afficher les réponses par date
Marc:
The compile times have gone up and down over the years with gcc.
Many of the decreases in compile time are due to improvements in algorithms or data structures.
Some are just from the compiler checking whether a function has too many basic blocks/gotos/labels/variables/... and turning off various optimizations that would take too long given the current algorithms and data structures. This is not always a bad idea: some optimizations are ineffective on very large functions, and the C files generated by Gambit *are* very large when compiled with -D___SINGLE_HOST.
On the other hand, the programmer may think that all the optimizations specified by -O2 are being applied to his/her code when, in fact, many of them are disabled. I thought that the programmer should be given the option to be warned about this, so in 2000 I suggested the option
-Wdisabled-optimizations
which could be used to inform the programmer when a specific optimization is disabled for whatever reason.
The use of this warning proved not to be popular with gcc developers, and perhaps I'm the only one who ever suggested places where it could be used (a few places in the GCSE and constant propagation code). It should be possible in a few hours work to track down every place where it is applicable (search for where the gcc code base checks various parameters that specify how big a function has to be before an optimization is disabled, and insert the warning there), but, really, the parameter checking code could be written so that this warning is inserted automatically in such places.
What I'm trying to say is that while this test gives a good study of gcc's default behavior, a broader study would be needed to see which optimizations are applied to Gambit-generated code, how long they take at compile time, and how much they benefit execution speed.
Brad
On 2012-04-29, at 10:52 AM, Bradley Lucier wrote:
Marc:
The compile times have gone up and down over the years with gcc.
Many of the decreases in compile time are due to improvements in algorithms or data structures.
Some are just from the compiler checking whether a function has too many basic blocks/gotos/labels/variables/... and turning off various optimizations that would take too long given the current algorithms and data structures. This is not always a bad idea: some optimizations are ineffective on very large functions, and the C files generated by Gambit *are* very large when compiled with -D___SINGLE_HOST.
On the other hand, the programmer may think that all the optimizations specified by -O2 are being applied to his/her code when, in fact, many of them are disabled. I thought that the programmer should be given the option to be warned about this, so in 2000 I suggested the option
-Wdisabled-optimizations
which could be used to inform the programmer when a specific optimization is disabled for whatever reason.
The use of this warning proved not to be popular with gcc developers, and perhaps I'm the only one who ever suggested places where it could be used (a few places in the GCSE and constant propagation code). It should be possible in a few hours work to track down every place where it is applicable (search for where the gcc code base checks various parameters that specify how big a function has to be before an optimization is disabled, and insert the warning there), but, really, the parameter checking code could be written so that this warning is inserted automatically in such places.
What I'm trying to say is that while this test gives a good study of gcc's default behavior, a broader study would be needed to see which optimizations are applied to Gambit-generated code, how long they take at compile time, and how much they benefit execution speed.
Are you suggesting this should be done for every version of gcc? It is hard enough to do for a single version, and the effort will mostly have to be redone for the next release.
If I were a gcc developer I might be motivated to do this, but I have my hands full with other stuff at the moment... Would you or someone else be interested in doing this?
Marc
On Apr 29, 2012, at 12:51 PM, Marc Feeley wrote:
On 2012-04-29, at 10:52 AM, Bradley Lucier wrote:
What I'm trying to say is that while this test gives a good study of gcc's default behavior, a broader study would be needed to see which optimizations are applied to Gambit-generated code, how long they take at compile time, and how much they benefit execution speed.
Are you suggesting this should be done for every version of gcc?
I'm not suggesting anything, except not to draw too broad conclusions from this broad study.
It is hard enough to do for a single version, and the effort will mostly have to be redone for the next release.
I've found that '-fschedule-insns' and '-frename-registers' help in x86_64 and powerpc code (not in i386 code, which doesn't have enough registers). It would be hard, without actually adding the code to gcc itself to implement -Wdisabled-optimization at all the right spots, to see what optimizations are actually performed, say, on _io.c with -O2.
If I were a gcc developer I might be motivated to do this,
I'm sorry, I've lost the thread here, what is "this"?
Would you or someone else be interested in doing this?
Adding the warnings in all the right places is on my "bucket list". (It's such a boring list, really.)
Brad
On Apr 28, 2012, at 10:42 PM, Marc Feeley wrote:
To measure the performance of the resulting system, I have executed the gsi interpreter on a moderately complex program (tests/mix.scm).
Marc:
On my mac, the interpreted and compiled times for mix.scm are
2.430334 secs elapsed cpu time
and
.391602 secs elapsed cpu time
respectively. I can't help but think that this test measures the speed of a relatively small amount of code in _eval.scm and the trampoline, as this seems to be over 80% of the run time.
Brad
On 2012-04-29, at 12:04 PM, Bradley Lucier wrote:
On Apr 28, 2012, at 10:42 PM, Marc Feeley wrote:
To measure the performance of the resulting system, I have executed the gsi interpreter on a moderately complex program (tests/mix.scm).
Marc:
On my mac, the interpreted and compiled times for mix.scm are
2.430334 secs elapsed cpu time
and
.391602 secs elapsed cpu time
respectively. I can't help but think that this test measures the speed of a relatively small amount of code in _eval.scm and the trampoline, as this seems to be over 80% of the run time.
Why is the comparison between the interpreted and compiled times leading you to that conclusion?
I agree with the statement in your conclusion, but not with the line of reasoning.
Also, I should have given the usual disclaimers about benchmarks. Here I am mostly interested in the build time and the speed of the interpreter. If you are interested in running more meaningfull benchmarks (more meaningfull for you) then please use my script to rerun the whole experiment.
Marc
On Apr 29, 2012, at 12:58 PM, Marc Feeley wrote:
Also, I should have given the usual disclaimers about benchmarks. Here I am mostly interested in the build time and the speed of the interpreter. If you are interested in running more meaningfull benchmarks (more meaningfull for you) then please use my script to rerun the whole experiment.
Well, I don't really care about the performance of all past versions of gcc, and as you've demonstrated here it's true that as old code has been replaced by new code, the performance of compiled Gambit code has not increased monotonically. (I've filed a number of gcc bugs about Gambit performance problems that were eventually closed after a number of years; for some of them, I don't know whether the original cause of the problem or the "fix" were ever identified.)
I think I'll post to the gcc mail list a link to this thread in case it's of interest to people.
Brad