Improved type specialization for dynamic scripting languages
Madhukar N. Kedlaya, Jared Roesch, Behnam Robatmili et al. · ACM SIGPLAN Notices · 2013
Type feedback and type inference are two common methods used to optimize dynamic languages such as JavaScript. Each of these methods has its own strengths and weaknesses, and we propose that each can benefit from the other if combined in the right way. We explore the interdependency between these two methods and propose two novel ways to combine them in order to significantly increase their aggregate benefit and decrease their aggregate overhead. In our proposed strategy, an initial type inference pass is applied that can reduce type feedback overhead by enabling more intelligent placement of profiling hooks. This initial type inference pass is novel in the literature. After profiling, a final type inference pass uses the type information from profiling to generate efficient code. While this second pass is not novel, we significantly improve its effectiveness in a novel way by feeding the type inference pass information about the function signature, i.e., the types of the function's arguments for aspecific function invocation. Our results show significant speedups when using these low-overhead strategies, ranging from 1.2x to 4x over an implementation that does not perform type feedback or type inference based optimizations. Our experiments are carried out across a wide range of traditional benchmarks and realistic web applications. The results also show an average reduction of 23.5% in the size of the profiled data for these benchmarks.
Cited by 1 works. doi:10.1145/2578856.2508177
Authors
References
- Common Lisp Object System specification
- Tracing the meta-level
- A framework for reducing the cost of instrumented code
- Reconciling responsiveness with performance in pure object-oriented languages
- Typechecking and modules for multimethods
- Fast and precise hybrid type inference for JavaScript
- Optimizing dynamically-dispatched calls with run-time type feedback
- Runtime feedback in a meta-tracing JIT for efficient dynamic languages
- ZOOMM
- Type feedback vs. concrete type inference