After some more
Google-ing, I discovered that this is a known problem.
In fact there is a
bug about it.
FontMetrics.stringWidth() is slow if the
String contains non-latin characters.
In my case the
Strings contain Hebrew characters.
In my application, I retrieve about 500
Strings from a database and invoke
FontMetrics.stringWidth() on each one - does that serve as
a proper benchmark?
In any case, I believe my original question is still the issue and that is:
Why is
FontMetrics.stringWidth() faster in jdk1.5.0_07?
In order to obtain an answer to that question, I guess I should compare the source code for the method in the different java versions.
So I will now
Google for the source code - but if someone can point me in the right direction, I would appreciate it.
Cheers,
Avi.