Title: Java program performance optimization