Optimization of StringsProjects > Compiler and JVM Research at JKU
We implemented an optimization that fuses the string object with its character array that holds the actual content. New bytecodes access the characters and allocate the strings. Nevertheless, the optimization is implemented completely inside the VM. The necessary bytecode rewriting is performed by the class loader. Optimized string objects are significantly smaller than the old string and its character array. This eliminates field loads, reduces the memory pressure, and the time necessary for garbage collection. It is a research project, but could show up in a future product version because it has a high impact on the performance.