Perhaps the
Performance forum was not the most appropriate?
Jeanne, I did not mention benchmarking. I asked if someone knows why there is a huge difference between the two JRE versions.
In any event the above code, in my application, runs only once anyway. The formatted
String serves as an entry in a combo box list.
I calculate the greatest (String) width in order to determine the width of the combo box's dropdown list.
Campbell, for your information, our application does not run correctly using Java 7 - but that's another story.
And also for your information, I ran the above code - which is merely meant to serve as a SSCCI - under Java 7 and got the following results:
jre1.7.0_79
String.format() = 464975000
FontMetrics.stringWidth() = 23905617
In other words, jre1.7.0_79 is three times slower than jre1.5.0_22
Cheers,
Avi.