Java Program Output Based Performance