Automatic, Template-Based Run-Time Specialization: Implementation and Experimental Study

  • Authors:
  • Francois Noel;Luke Hornof;Charles Consel;Julia L. Lawall

  • Affiliations:
  • -;-;-;-

  • Venue:
  • ICCL '98 Proceedings of the 1998 International Conference on Computer Languages
  • Year:
  • 1998

Quantified Score

Hi-index 0.00

Visualization

Abstract

Specializing programs with respect to run-time values has been shown to drastically improve code performance on realistic programs ranging from operating systems to graphics. Recently, various approaches to specializing code at run-time have been proposed. However, these approaches still suffer from shortcomings that limit their applicability: they are manual, too expensive, or require programs to be written in a dedicated language.We solve these problems by introducing new techniques to implement run-time specialization. The key to our approach is the use of code templates. Templates are automatically generated from ordinary programs and are optimized before run time, allowing high-quality code to be quickly generated at run time.Experimental results obtained on scientific and graphics code indicate that our approach is highly effective. Little run-time overhead is introduced, since code generation primarily consists of copying instructions. Run-time specialized programs run up to 10 times faster, and are nearly as fast as fully optimized programs (80% on average). The combination of low run-time overhead and high code quality enables specialization to be amortized in as few as 3 runs.Although this approach is highly effective, its implementation is relatively simple since it exploits existing partial evaluation and compiler technologies.