Optimizing ML with run-time code generation
Peter Lee, Mark Leone · Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation · 1996
We describe the design and implementation of a compiler that automatically translates ordinary programs written in a subset of ML into code that generates native code at run time. Run-time code generation can make use of values and invariants that cannot be exploited at compile time, yielding code that is often superior to statically optimal code. But the cost of optimizing and generating code at run time can be prohibitive. We demonstrate how compile-time specialization can reduce the cost of run-time code generation by an order of magnitude without greatly affecting code quality. Several benchmark programs are examined, which exhibit an average cost of only six cycles per instruction generated at run time.
Cited by 204 works. doi:10.1145/231379.231407 Open-access PDF
References
- The BSD packet filter: a new architecture for user-level packet capture
- Extensibility safety and performance in the SPIN operating system
- The packer filter: an efficient mechanism for user-level network code
- Efficient implementation of the smalltalk-80 system
- Shade: a fast instruction-set simulator for execution profiling
- Programming Techniques: Regular expression search algorithm
- Partial evaluation and automatic program generation
- Compiling with Continuations
- Optimistic incremental specialization
- TIL