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 条
  • [21] A generic static analyzer for multithreaded Java']Java programs
    Ferrara, P.
    [J]. SOFTWARE-PRACTICE & EXPERIENCE, 2013, 43 (06): : 663 - 684
  • [22] Converting Java']Java programs to use generic libraries
    Donovan, A
    Kiezun, A
    Tschantz, MS
    Ernst, MD
    [J]. ACM SIGPLAN NOTICES, 2004, 39 (10) : 15 - 34
  • [23] Java']Java & monetary data
    Armstrong, JN
    [J]. DR DOBBS JOURNAL, 2004, 29 (05): : 52 - +
  • [24] HPJava']Java:: data parallel extensions to Java']Java
    Carpenter, B
    Zhang, GS
    Fox, G
    Li, XY
    Wen, YH
    [J]. CONCURRENCY-PRACTICE AND EXPERIENCE, 1998, 10 (11-13): : 873 - 877
  • [25] ImgLib2-generic image processing in Java']Java
    Pietzsch, Tobias
    Preibisch, Stephan
    Tomancak, Pavel
    Saalfeld, Stephan
    [J]. BIOINFORMATICS, 2012, 28 (22) : 3009 - 3011
  • [26] Checkmate: a Generic Static Analyzer of Java']Java Multithreaded Programs
    Ferrara, Pietro
    [J]. SEFM 2009: SEVENTH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING AND FORMAL METHODS, 2009, : 169 - 178
  • [27] A comparative evaluation of generic programming in Java']Java and C++
    Saiedian, H
    Hill, S
    [J]. SOFTWARE-PRACTICE & EXPERIENCE, 2003, 33 (02): : 121 - 142
  • [28] Efficiently refactoring Java']Java applications to use generic libraries
    Fuhrer, R
    Tip, F
    Kiezun, A
    Dolby, J
    Keller, M
    [J]. ECOOP 2005 - OBJECT-ORIENTED PROGRAMMING, PROCEEDINGS, 2005, 3586 : 71 - 96
  • [29] Corrective Hints for Type Incorrect Generic Java']Java Programs
    el Boustani, Nabil
    Hage, Jurriaan
    [J]. PEPM '10: PROCEEDINGS OF THE 2010 ACM SIGPLAN WORKSHOP ON PARTIAL EVALUATION AND PROGRAM MANIPULATION, 2010, : 5 - 14
  • [30] Teaching data structures and algorithms in a software engineering degree: Some experience with Java']Java
    Cowling, AJ
    [J]. 14TH CONFERENCE ON SOFTWARE ENGINEERING EDUCATION AND TRAINING, PROCEEDINGS, 2001, : 247 - 257