[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug awt/24318] FontMetrics charsWidth performance

From: sven at physto dot se
Subject: [Bug awt/24318] FontMetrics charsWidth performance
Date: 14 Oct 2005 21:53:22 -0000

------- Comment #2 from sven at physto dot se  2005-10-14 21:53 -------
Yeah, I looked into this with the Qt peers and using stringWidth (which is
implemented directly in native), although the difference versus using
charsWidth wasn't really signficiant.

I don't think this is a signficant bug. The benchmark test does 100,000 runs of
strings which are rather short. On my machine the run took about 24 seconds
with the Qt peers and jamvm. Out of that, about 0.5 seconds were spent on the
JNI call, one second on converting the input to native, and the rest spent in
the actual toolkit fontmetric method. This cannot be improved upon

On the other hand, I don't feel this is slow. 24 seconds for 100,000 strings
means an average of 0.24 microseconds per string. This is microoptimization.
It's hard to improve on such a small number. Is it really needed? E.g. how many
strings to you have on-screen at any time? I'd say about a hundred, taking 24
milliseconds to layout the text isn't a problem.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]