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 条
  • [41] Do Developers Benefit from Generic Types? An Empirical Comparison of Generic and Raw Types in Java']Java
    Hoppe, Michael
    Hanenberg, Stefan
    [J]. ACM SIGPLAN NOTICES, 2013, 48 (10) : 457 - 474
  • [42] Data size optimizations for Java']Java programs
    Ananian, CS
    Rinard, M
    [J]. ACM SIGPLAN NOTICES, 2003, 38 (07) : 59 - 68
  • [43] Data visualization using Java']Java and VRML
    Li, LX
    Barnes, A
    [J]. PROCEEDINGS OF THE TWENTY-THIRD ANNUAL SAS USERS GROUP INTERNATIONAL CONFERENCE, 1998, : 911 - 916
  • [44] Importing and exporting data in (Java']Java) VisAD
    Emmerson, SR
    Hibbard, WL
    Rink, T
    [J]. 14TH INTERNATIONAL CONFERENCE ON INTERACTIVE INFORMATION AND PROCESSING SYSTEM (IIPS) FOR METEOROLOGY, OCEANOGRAPHY, AND HYDROLOGY, 1998, : 225 - 226
  • [45] TRaDe: Data race detection for Java']Java
    Christiaens, M
    De Bosschere, K
    [J]. COMPUTATIONAL SCIENCE -- ICCS 2001, PROCEEDINGS PT 2, 2001, 2074 : 761 - 770
  • [46] Remote data analysis using Java']Java
    Kuhlins, S
    Schader, M
    [J]. CLASSIFICATION IN THE INFORMATION AGE, 1999, : 359 - 367
  • [47] Extensible Modeling with Managed Data in Java']Java
    Zacharopoulos, Theologos
    Inostroza, Pablo
    van der Storm, Tijs
    [J]. ACM SIGPLAN NOTICES, 2017, 52 (03) : 25 - 35
  • [48] Data Analytics and Machine Learning with Java']Java
    Zhelev, Svetoslav
    Rozeva, Anna
    [J]. PROCEEDINGS OF THE 44TH INTERNATIONAL CONFERENCE "APPLICATIONS OF MATHEMATICS IN ENGINEERING AND ECONOMICS", 2018, 2048
  • [49] A Java']Java framework for mobile data synchronization
    Cohen, NH
    [J]. COOPERATIVE INFORMATION SYSTEMS, PROCEEDINGS, 2000, 1901 : 287 - 298
  • [50] Java's generic connection framework
    Tremblett, Paul
    [J]. Dr. Dobb's Journal, 2002, 27 (04):