Object Specialization to Partially Reduce Polymorphism of Attributes

Alena Vasileva, Yegor Bugayenko · 2023

In object-oriented programming languages, objects with polymorphic attributes can negatively impact performance and hinder static analysis. These attributes require dynamic dispatch, which is slower than static binding, and complicate the analysis process. We propose a novel algorithm for object specialization that addresses this issue by replacing polymorphic attributes with monomorphic ones, resulting in improved performance and simplified static analysis. Our algorithm is a new approach compared to existing function specialization algorithms. We provide a proof of the algorithm’s soundness and correctness, and present an implementation of the algorithm as a software tool. Empirical evaluation shows that our approach achieves significant improvements in performance and simplifies the static analysis process. Our algorithm can be applied to a variety of object-oriented languages such as Java and Python.

Read the paper · More papers on PaperTik