Abstract
Object Inlining (OI) is a known optimization in object oriented programming in which referenced objects of class B are inlined into their referencing objects of class A by making all fields and methods of class B part of class A. The optimization saves all the new operations of B type objects from class A and at the same time replaces all indirect accesses, from A to fields of B, by direct accesses. To the best of our knowledge, in-spite of the significant performance potential of the OI optimization, reported performance measurements were relatively moderate. This is because an aggressive OI optimization requires complex analysis and code transformations to overcome problems like multiple references to the inlinable object, object references that escape their object scope, etc.
To extract the full potential of OI, we propose a two-stage process. The first stage includes automatic analysis of the source code that informs the user, via comments in the IDE, about code transformations that are needed in order to enable or to maximize the potential of the OI optimization. In the second stage, the OI optimization is applied automatically on the source code as a code refactoring operation, or preferably, as part of the compilation process prior to javac run.
We show that this half-automated technique helps to extract the full potential of OI. The proposed OI refactoring process also determines the order of applying the inlinings of the objects and enables us to apply inlinings of objects created inside a method; thus enabling us to reach better performance gain.
In this work we also include an evaluation of the OI optimization effects on multithreaded applications running on multicore machines.
The comments and the OI transformation were implemented in the Eclipse JDT (Java Development Tools) plugin. The system was then applied on the SPECjbb2000 source code along with profiling data collected by the Eclipse TPTP plugin. The proposed system achieved 46% improvement in performance.
Similar content being viewed by others
References
Dolby, J.: Automatic inline allocation of objects. In: ACM SIGPLAN 1997 PLDI Conference on Programming Language Design and Implementation, pp. 7–17 (1997)
Dolby, J., Chien, A.A.: An evaluation of automatic object inline allocation techniques. In: Conference on Object-Oriented, pp. 1–20 (1998)
Dolby, J., Chien, A.A.: An automatic object inlining optimization and its evaluation. In: PLDI ’00: Proceedings of the ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation, pp. 345–357 (2000)
Eades, P., Lin, X., Smyth, W.F.: A fast and effective heuristic for the feedback arc set problem. Inf. Process. Lett. 47, 319–323 (1993)
Ghemawat, S., Randall, K.H., Scales, D.J.: Field analysis: getting useful and low-cost interprocedural information. In: ACM SIGPLAN Conference on Programming Language Design and Implementation (2000)
Karlsson, M., Moore, K.E., Hagersten, E., Wood, D.A.: Memory system behavior of java-based middleware. In: Proceedings of the Ninth International Symposium on High Performance Computer Architecture, pp. 217–228 (2003)
Keeton, K., Patterson, D., He, Y., Raphael, R., Baker, W.: Performance characterization of a quad Pentium Pro SMP using OLTP workloads. In: Annual International Symposium on Computer Architecture, pp. 15–26 (1998)
Laud, P.: Analysis for object inlining in Java. In: Proceedings of the Joses Workshop, pp. 1–8 (2001)
Lhoták, O., Hendren, L.: Run-time evaluation of opportunities for object inlining in Java. In: JGI ’02: Proceedings of the 2002 Joint ACM-ISCOPE Conference on Java Grande, pp. 175–184 (2002)
Shuf, Y.S.M.J., Gupta, M., Singh, J.P.: Characterizing the memory behavior of Java workloads: a structured view and opportunities for optimizations. SIGMETRICS Perform. Eval. Rev. 29(1) (2001)
Shuf, Y., Gupta, M., Franke, H., Appel, A., Singh, J.P.: Creating and preserving locality of Java applications at allocation and garbage collection times. In: OOPSLA ’02: Proceedings of the 17th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (2002)
Wimmer, C., Mössenböck, H.: Automatic feedback-directed object inlining in the Java Hotspot Virtual Machine. In: VEE ’07: Proceedings of the 3rd International Conference on Virtual Execution Environments (2007)
Wimmer, C., Mössenböök, H.: Automatic array inlining in Java Virtual Machines. In: CGO ’08: Proceedings of the Sixth Annual IEEE/ACM International Symposium on Code Generation and Optimization (2008)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Ben Asher, Y., Gal, T., Haber, G. et al. Refactoring techniques for aggressive object inlining in Java applications. Autom Softw Eng 19, 97–136 (2012). https://doi.org/10.1007/s10515-011-0096-x
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10515-011-0096-x