Java is one of the most widely used programming languages in the world with its object-oriented design paradigm, centered around the concept of objects. Objects serve as data structures that enable developers to model concepts and entities in an intuitive and robust manner. However, this power incurs significant overhead in terms of memory usage and performance. To tackle these limitations, Project Valhalla has proposed the introduction in the Java language of a new feature, Value Types. Unlike traditional objects, value-type objects do not possess identity, allowing for new and impactful optimizations and performance enhancements. Despite being designed for minimal disruption and ease of adoption, the integration of this new feature poses challenges in transitioning existing codebases. To facilitate this process, this thesis proposes "ValMaker", a tool for automatic value-type refactoring of Java code. It assists developers in integrating value types into existing codebases, while mitigating errors and fostering best practices. The implementation of this tool required the development of a refactoring program capable of transforming conventional Java code into its value-type equivalent, while preserving program correctness. The refactorings range from basic modifications to more advanced and innovative refactoring procedures. To enable the refactorings process, it was essential to integrate a static analysis module, which systematically examines the input code to identify existing and new opportunities for value-type adoption while maintaining soundness. To conclude, the effectiveness, utility and correctness of the tool was evaluated using industry-standard benchmarks. The findings presented in this thesis demonstrate that ValMaker provides a practical and efficient solution to the challenge of value-type refactoring of Java code. Furthermore, it offers valuable insights into value types and their constraints, contributing to the broader Java development community.
Java è uno dei linguaggi di programmazione più utilizzati al mondo, grazie al suo paradigma di programmazione orientato agli oggetti. Gli oggetti fungono da strutture dati che consentono agli sviluppatori di modellare concetti ed entità in modo intuitivo e robusto. Tuttavia, questo potente strumento comporta un significativo costo in termini di memoria e prestazioni. Per superare queste limitazioni, il Progetto Valhalla ha proposto l'introduzione di una nuova funzionalità in Java: i Value Types. A differenza degli oggetti tradizionali, i value types non possiedono identità, aprendo così la strada a nuove e significative ottimizzazioni e miglioramenti delle prestazioni. Nonostante questa funzionalità sia stata progettata per ridurre al minimo le inconvenienze e semplificarne l'adozione, la sua integrazione pone delle sfide nella transizione dei codebase esistenti. Per facilitare questo processo, questa tesi propone "ValMaker", uno strumento per la rifattorizzazione automatica del codice Java incentrata sui value types. Esso assiste gli sviluppatori nell'integrazione dei value types nei codebase esistenti, riducendo errori e promuovendo best practices. L'implementazione di questo strumento ha richiesto lo sviluppo di un programma di rifattorizzazione in grado di trasformare codice Java convenzionale nel suo equivalente basato sui value types, preservandone il significato e la correttezza. Le rifattorizzazioni spaziano da semplici modifiche basilari a procedure più complesse e innovative. Per abilitare il processo di rifattorizzazione, è stato fondamentale integrare un modulo di analisi statica, che esamina sistematicamente il codice in input per individuare opportunità esistenti e nuove per l'adozione dei value types. Infine, l'efficacia, l'utilità e la correttezza dello strumento è stata valutata utilizzando benchmark di riferimento standard del settore. I risultati presentati in questa tesi dimostrano come ValMaker fornisca una soluzione pratica, efficace ed efficiente alla sfida della rifattorizzazione del codice Java per l'adozione dei value types. Inoltre, offre preziose nozioni riguardanti quest'ultimi e i loro limiti, un utile contributo per la più ampia comunità di sviluppatori Java.
Code transformations for optimizing Java performance with value types
PROSCH, LORENZO
2024/2025
Abstract
Java is one of the most widely used programming languages in the world with its object-oriented design paradigm, centered around the concept of objects. Objects serve as data structures that enable developers to model concepts and entities in an intuitive and robust manner. However, this power incurs significant overhead in terms of memory usage and performance. To tackle these limitations, Project Valhalla has proposed the introduction in the Java language of a new feature, Value Types. Unlike traditional objects, value-type objects do not possess identity, allowing for new and impactful optimizations and performance enhancements. Despite being designed for minimal disruption and ease of adoption, the integration of this new feature poses challenges in transitioning existing codebases. To facilitate this process, this thesis proposes "ValMaker", a tool for automatic value-type refactoring of Java code. It assists developers in integrating value types into existing codebases, while mitigating errors and fostering best practices. The implementation of this tool required the development of a refactoring program capable of transforming conventional Java code into its value-type equivalent, while preserving program correctness. The refactorings range from basic modifications to more advanced and innovative refactoring procedures. To enable the refactorings process, it was essential to integrate a static analysis module, which systematically examines the input code to identify existing and new opportunities for value-type adoption while maintaining soundness. To conclude, the effectiveness, utility and correctness of the tool was evaluated using industry-standard benchmarks. The findings presented in this thesis demonstrate that ValMaker provides a practical and efficient solution to the challenge of value-type refactoring of Java code. Furthermore, it offers valuable insights into value types and their constraints, contributing to the broader Java development community.File | Dimensione | Formato | |
---|---|---|---|
2025_04_Prosch_Tesi.pdf
accessibile in internet solo dagli utenti autorizzati
Descrizione: Tesi
Dimensione
711.37 kB
Formato
Adobe PDF
|
711.37 kB | Adobe PDF | Visualizza/Apri |
2025_04_Prosch_Executive Summary.pdf
accessibile in internet solo dagli utenti autorizzati
Descrizione: Executive Summary
Dimensione
379.84 kB
Formato
Adobe PDF
|
379.84 kB | Adobe PDF | Visualizza/Apri |
I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.
https://hdl.handle.net/10589/234419