Abstract
The use of class libraries increases programmer productivity by allowing programmers to focus on the functionality unique to their application. However, library classes are generally designed with some typical usage pattern in mind, and performance may be suboptimal if the actual usage differs. We present an approach for rewriting applications to use customized versions of library classes that are generated using a combination of static analysis and profile information. Type constraints are used to determine where customized classes may be used, and profile information is used to determine where customization is likely to be profitable. We applied this approach to a number of Java applications by customizing various standard container classes and the omnipresent StringBuffer class, and measured speedups up to 78% and memory footprint reductions up to 46%. The increase in application size due to the added custom classes is limited to 12% for all but the smallest programs.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Beckmann, B., Wang, X.: Adaptive prefetching Java objects (manuscript)
Cai, J., Paige, R.: Towards increased productivity of algorithm implementation. In: Proc. 1st ACM SIGSOFT symposium on Foundations of software engineering, pp. 71–78 (1993)
Calder, B., Feller, P., Eustace, A.: Value profiling. In: Proceedings of the 30th annual ACM/IEEE International Symposium on Microarchitecture (ISCA 1997), pp. 259–269 (1997)
Chambers, C., Ungar, D.: Customization: optimizing compiler technology for SELF, a dynamically-typed object-oriented programming language. ACM SIGPLAN Notices 24(7), 146–160 (1989)
Choi, J.-D., Gupta, M., Serrano, M.J., Sreedhar, V.C., Midkiff, S.P.: Stack allocation and synchronization optimizations for java using escape analysis. ACM Transactions on Programming Languages and Systems 25(6), 876–910 (2003)
Chung, E.-Y., Benini, L., De Micheli, G.: Automatic source code specialization for energy reduction. In: Proceedings of the 2001 International Symposium on Low Power Electronics and Design (ISPLED 2001), pp. 80–83 (2001)
Cooper, K., Hall, M.W., Kennedy, K.: A methodology for procedure cloning. Computer Languages (may 1995)
Czarnecki, K., Eisenecker, U.: Generative Programming: Methods, Techniques, and Applications. Addison-Wesley, Reading (1999)
Dewar, R.K., Arthur, L.S.-C., Schwartz, J.T., Schonberg, E.: Programming by refinement, as exemplified by the SETL representation sublanguage. ACM Transactions on Programming Languages and Systems (TOPLAS) 1(1), 27–49 (1979)
Fowler, M.: Refactoring. Improving the Design of Existing Code. Addison-Wesley, Reading (1999)
Friedman, S., Leidenfrost, N., Brodie, B., Cytron, R.: Hashtables for embedded and real-time systems. In: IEEE Real-Time Embedded System Workshop (2001)
Glew, N., Palsberg, J.: Type-safe method inlining. In: Proc. 16th European Conference on Object-Oriented Programming, pp. 525–544 (2002)
Hind, M., Pioli, A.: Evaluating the effectiveness of pointer alias analyses. Science of Computer Programming 39(1), 31–55 (2001)
Högstedt, K., D., K., Rajan, V., Roth, T., Sreedhar, V., Wegman, M., Wang, N.: The autonomic performance prescription. Available from the author at wegman@watson.ibm.com
Kiczales, G., Lamping, J., Menhdhekar, A., Maeda, C., Lopes, C., Loingtier, J.-M., Irwin, J.: Aspect-oriented programming. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)
Lindholm, T., Yellin, F.: The Java Virtual Machine Specification. Addison-Wesley, Reading (1997)
Palsberg, J.: Type-based analysis and applications. In: ACM Workshop on Program Analysis for Software Tools and Engineering (PASTE 2001), Snowbird, UT, pp. 20–27 (2001)
Palsberg, J., Schwartzbach, M.: Object-Oriented Type Systems. John Wiley & Sons, Chichester (1993)
Pavlovic, D., Smith, D.: Software development by refinement. In: UNU/IIST 10th Anniversary Colloqium, Formal Methods at the Crossroads: From Panaea to Foundational Support, Springer, Heidelberg (2003)
Rountev, A., Milanova, A., Ryder, B.: Points-to analysis for Java using annotated constraints. In: Proc. 16th Annual Conf. on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA 2001), Tampa Bay, FL, pp. 43–55 (2001)
Ryder, B.G.: Dimensions of precision in reference analysis of object-oriented programming languages. In: Proc. 12th International Conference on Compiler Construction (CC 2003), Warsaw, Poland, April 2003, pp. 126–137 (2003)
Schonberg, E., Schwartz, J., Sharir, M.: An automatic technique for selection of data representations in SETL programs. ACM Transactions on Programming Languages and Systems 3(2), 126–143 (1981)
Schultz, U.P., Lawall, J.L., Consel, C.: Automatic program specialization for java. ACM Transactions on Programming Languages and Systems 25(4), 452–499 (2003)
Sirkin, M., Batory, D., Singhal, V.: Software components in a data structure precompiler. In: Proceedings of the 15th International Conference on Software Engineering (ICSE 1997), pp. 437–446 (1997)
Tip, F., Kieżun, A., Bäumer, D.: Refactoring for generalizations using type constraints. In: Proc. 18th Annual Conf. on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA 2003 (2003)
Tip, F., Sweeney, P.F., Laffra, C., Eisma, A., Streeter, D.: Practical extraction techniques for Java. ACM Transactions on Programming Languages and Systems 24(6), 625–666 (2002)
Veldhuizen, T.L., Gannon, D.: Active libraries: Rethinking the roles of compilers and libraries. In: Proceedings of the SIAM Workshop on Object Oriented Methods for Inter-operable Scientific and Engineering Computing, OO 1998 (1998)
Yellin, D.: Competitive algorithms for the dynamic selection of component implementations. IBM Systems Journal 42(1), 85–97 (2003)
Yotov, K., Li, X., Ren, G., Cibulskis, M., DeJong, G., Garzaran, M., Padua, D., Pingali, K., Stodghill, P., Wu, P.: Comparison of empirical and model-driven optimization. In: Proc. ACM SIGPLAN 2003 conference on Programming language design and implementation, pp. 63–76 (2003)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
De Sutter, B., Tip, F., Dolby, J. (2004). Customization of Java Library Classes Using Type Constraints and Profile Information. In: Odersky, M. (eds) ECOOP 2004 – Object-Oriented Programming. ECOOP 2004. Lecture Notes in Computer Science, vol 3086. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24851-4_27
Download citation
DOI: https://doi.org/10.1007/978-3-540-24851-4_27
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-22159-3
Online ISBN: 978-3-540-24851-4
eBook Packages: Springer Book Archive