ABSTRACT
The flat-closure model for the representation of first-class procedures is simple, safe-for-space, and efficient, allowing the values or locations of free variables to be accessed with a single memory indirect. It is a straightforward model for programmers to understand, allowing programmers to predict the worst-case behavior of their programs. This paper presents a set of optimizations that improve upon the flat-closure model along with an algorithm that implements them, and it shows that the optimizations together eliminate over 50% of run-time closure-creation and free-variable access overhead in practice, with insignificant compile-time overhead. The optimizations never add overhead and remain safe-for-space, thus preserving the benefits of the flat-closure model.
- A. Appel. Private communication. 1994.Google Scholar
- A. W. Appel. Compiling with Continuations. Cambridge University Press, 40 West 20th Street, New York, NY 10011-4211, 1992. Google ScholarDigital Library
- A. W. Appel. Closure conversion, chapter 10, pages 103--124. Cambridge University Press, 40 West 20th Street, New York, NY 10011-4211, 1992.Google Scholar
- L. Cardelli. The functional abstract machine. Technical report, Bell Laboratories, 1983.Google Scholar
- W. D. Clinger. Description of benchmarks, 2008. URL http://www.larcenists.org/benchmarksAboutR6.html. Accessed Oct 20, 2011.Google Scholar
- I. Dragoş. Optimizing Higher-Order Functions in Scala. In Third International Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems, 2008.Google Scholar
- R. K. Dybvig. Three Implementation Models for Scheme. PhD thesis, University of North Carolina, Chapel Hill, Apr. 1987. Google ScholarDigital Library
- P. Fradet and D. Le Métayer. Compilation of functional languages by program transformation. ACM Trans. Program. Lang. Syst., 13:21--51, January 1991. ISSN 0164-0925.. URL http://doi.acm.org/10.1145/114005.102805. Google ScholarDigital Library
- A. Ghuloum and R. K. Dybvig. Fixing letrec (reloaded). In Proceedings of the 2009 Workshop on Scheme and Functional Programming, pages 57--65, 2009.Google Scholar
- J. Guy L. Steele. Rabbit: A compiler for scheme. Technical report, Massachusetts Institute of Technology, Cambridge, MA, USA, 1978. Google ScholarDigital Library
- T. Johnsson. Lambda lifting: Transforming programs to recursive equations. In Proceedings 1985 Conference on Functional Programming Languages and Compiler Architecture, pages 190--203. Springer-Verlag, 1985. Google ScholarDigital Library
- D. A. Kranz. ORBIT: An Optimizing Compiler for Scheme. PhD thesis, Yale University, 1988. Google ScholarDigital Library
- M. Serrano. Control flow analysis: A functional languages compilation paradigm. In Proceedings of the 1995 ACM symposium on Applied computing, pages 118--122. ACM, 1995.. Google ScholarDigital Library
- Z. Shao and A. W. Appel. Efficient and safe-for-space closure conversion. ACM TOPLAS, 22:129--161, 2000. Google ScholarDigital Library
- O. Shivers. Control flow analysis in Scheme. In Proceedings of the ACM SIGPLAN 1988 conference on Programming Language design and Implementation, pages 164--174. ACM, 1988.. Google ScholarDigital Library
- M. Sperber, R. K. Dybvig, M. Flatt, A. Van Straaten, R. Findler, and J. Matthews. Revised6 report on the algorithmic language scheme. Journal of Functional Programming, 19(Supplement S1):1--301, 2009.. URL http://dx.doi.org/10.1017/S0956796809990074. Google ScholarDigital Library
- P. A. Steckler and M. Wand. Lightweight closure conversion. ACM Trans. Program. Lang. Syst., 19:48--86, January 1997. ISSN 0164-0925.. URL http://doi.acm.org/10.1145/239912.239915. Google ScholarDigital Library
- R. E. Tarjan. Depth-first search and linear graph algorithms. SIAM J. Comput., 1(2):146--160, 1972.Google ScholarDigital Library
- O. Waddell, D. Sarkar, and R. K. Dybvig. Fixing letrec: A faithful yet efficient implementation of Scheme's recursive binding construct. Higher-order and and symbolic computation, 18(3/4):299--326, 2005. Google ScholarDigital Library
Recommendations
Optimizing away C++ exception handling
A high performance implementation of C++ exception handling is crucial, because exception handling overhead is distributed across all code. The commonly-used table-driven approach to implementing exception handling can be augmented by an optimization ...
Optimizing array bound checks using flow analysis
Bound checks are introduced in programs for the run-time detection of array bound violations. Compile-time optimizations are employed to reduce the execution-time overhead due to bound checks. The optimizations reduce the program execution time through ...
Ant Colony System for Optimizing Vehicle Routing Problem with Time Windows
CIMCA '05: Proceedings of the International Conference on Computational Intelligence for Modelling, Control and Automation and International Conference on Intelligent Agents, Web Technologies and Internet Commerce Vol-2 (CIMCA-IAWTIC'06) - Volume 02Research on optimization of the Vehicle Routing Problem with Time Windows (VRPTW) is one of the most significant and promising areas of investigation in ant colony system (ACS), since ACS is used to find a near-optimum solution for a discrete ...
Comments