The inlining threshold determines the maximum weight assigned to a function or iterator to be considered for inlining. In all measurements, the same thresholds were used for both functions and iterators. The weight is assigned by traversing the AM representation of a function and accumulating the weights assigned to expressions and statements.
The methodology of this experiment was the same as in for the FFT. The program compiled with different levels of inlining was run for three different problem sizes. As in the FFT case, the results are pretty consistent, and the change in the executable size is practically unobservable due to the page granularity of Sparc object code.
The Sather compiler experiment shows a very similar trend, although speedups are somewhat lower. The maximum speedup is about 12% for inlining threshold 16. Moreover, this also corresponds to the reduction of the executable size by 32K. Compilation times for the peak are about 15-20% larger than for non-inlining compilation. If C compilation were included in the measurements, these numbers would be more then twice lower.
It is interesting that all measurements seem to agree that the optimum inlining levels for Sparcs is about 16 in spite of the difference in algorithms, program sizes, coding styles, etc. Such inlining also corresponds to the reduction in executables sizes in the case of Sather compiler. The slowdown in compilation times due to additional complexity is reasonable and perheaps could be reduced even more. Moreover, if the compiler itself is built with inlining, it is about 10-12% faster, and thus it can generate tfaster inlined code at the same time as the old compiler generated slower code with no inlining. As expected, the benefits for the Sather compiler are somewhat less significant than for the other programs due to a large amount of I/O.
To override default inlining for exotic architectures or programs, two other options could be used:
-inline_functions level
-inline_iterators level
As measurements show, the best speedups are achieved for level<100
-fast option provides default inlining for functions and iterators.
-optimize, -O options provide default inlining for functions and iterators.