Specializing Generic Java']Java Data Structures

被引:1
|
作者
Graur, Dan [1 ]
Bruno, Rodrigo [2 ]
Alonso, Gustavo [1 ]
机构
[1] Swiss Fed Inst Technol, Dept Comp Sci, Syst Grp, Zurich, Switzerland
[2] ULisboa, INESC ID Tecn, Lisbon, Portugal
关键词
!text type='Java']Java[!/text; data structures; code generation; runtime; specialization; generics; optimization;
D O I
10.1145/3475738.3480718
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
The Collections framework is an essential utility in virtually every Java application. It offers a set of fundamental data structures that exploit Java Generics and the Object type in order to enable a high degree of reusability. Upon instantiation, Collections are parametrized by the type they are meant to store. However, at compile-time, due to type erasure, this type gets replaced by Object, forcing the data structures to manipulate references of type Object (the root of the Java type system). In the bytecode, the compiler transparently adds type checking instructions to ensure type safety, and generates bridge methods to enable the polymorphic behavior of parametrized classes. This approach can introduce non-trivial runtime overheads when applications extensively manipulate Collections. We propose the Java Collections Specializer (JCS), a tool we have developed to deliver truly specialized Collections. JCS can generate ArrayLists, ConcurrentHashMaps and HashMaps with true type specialization that incur no performance penalties due to bridge methods or type checking instructions. JCS offers the possibility to easily extend its use to other Collection data structures. Since the specialized data structures extend and inherit from the generic counterpart's superclasses and interfaces, the specialized versions can be used in most places where generic versions are employed. The programmer uses JCS to generate specializations ahead of time. These are generated under the java.util package, and need only be added to the class path and integrated into the application logic. We show that the specialized data structures can improve the runtime performance of data intensive workloads by up to 14% for read use-cases and 42% for write use-cases.
引用
收藏
页码:45 / 53
页数:9
相关论文
共 50 条
  • [1] Specializing Java']Java programs in a distributed environment
    Park, JG
    Park, MS
    [J]. JOURNAL OF INFORMATION SCIENCE AND ENGINEERING, 2002, 18 (05) : 787 - 801
  • [2] Generic ownership for generic Java']Java
    Potanin, Alex
    Noble, James
    Clarke, Dave
    Biddle, Robert
    [J]. ACM SIGPLAN NOTICES, 2006, 41 (10) : 311 - 324
  • [3] Data structures in Java']Java for matrix computations
    Gundersen, G
    Steihaug, T
    [J]. CONCURRENCY AND COMPUTATION-PRACTICE & EXPERIENCE, 2004, 16 (08): : 799 - 815
  • [4] JDSL: The data structures library in Java']Java
    Tamassia, R
    Goodrich, MT
    Vismara, L
    Handy, M
    Shubina, G
    Cohen, R
    Hudson, B
    Baker, RS
    Gelfand, N
    Brandes, U
    [J]. DR DOBBS JOURNAL, 2001, 26 (04): : 21 - +
  • [5] GJ: A generic Java']Java
    Wadler, P
    [J]. DR DOBBS JOURNAL, 2000, 25 (02): : 23 - +
  • [6] Safe instantiation in Generic Java']Java
    Allen, EE
    Cartwright, R
    [J]. SCIENCE OF COMPUTER PROGRAMMING, 2006, 59 (1-2) : 26 - 37
  • [7] Ownership and Immutability in Generic Java']Java
    Zibin, Yoav
    Potanin, Alex
    Li, Paley
    Ali, Mahmood
    Ernst, Michael D.
    [J]. ACM SIGPLAN NOTICES, 2010, 45 (10) : 598 - 617
  • [8] Towards Specializing Java']JavaScript Programs
    Thiemann, Peter
    [J]. PERSPECTIVES OF SYSTEM INFORMATICS, PSI 2014, 2015, 8974 : 320 - 334
  • [9] Adding tuples to Java']Java: a study in lightweight data structures
    van Reeuwijk, C
    Sips, HJ
    [J]. CONCURRENCY AND COMPUTATION-PRACTICE & EXPERIENCE, 2005, 17 (5-6): : 423 - 438
  • [10] Diagnosing java']java programs with static abstractions of data structures
    Chen, R
    Koeb, D
    Wotawa, F
    [J]. INTELLIGENT INFORMATION PROCESSING II, 2005, 163 : 369 - 372