Improved type specialization for dynamic scripting languages

Madhukar N. Kedlaya, Jared Roesch, Behnam Robatmili, Mehrdad Reshadi, Ben Hardekopf
2013 Proceedings of the 9th symposium on Dynamic languages - DLS '13  
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
more » ... ce 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 a specific function invocation. Our results show significant speedups when using these low-overhead strategies, ranging from 1.2× to 4× 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.
doi:10.1145/2508168.2508177 dblp:conf/dls/KedlayaRRRH13 fatcat:lkoth7znezclfppthjgpzh6dgi