> It looks like on OSX (and also on Xft) the
> single-character call is implemented by making a 1-character string
> and measuring that, so it is a total waste of time.

The present working is that such a call is indeed done, but only
once, the first time each character is encountered. The resulting
width is memorized and returned by all successive character
measurement requests.


> I suspect the overhead of constructing the arguments and doing the
> system call is much more important than the time the system actually
> spends measuring, so minimizing these calls is much more important than
> minimizing how much data is sent.

As said above, there's no system call involved here, just a loop
that adds up pre-memorized single-character widths.

The previous implementation did make a system call to measure each
string and was called by Fl_Text_Display with single characters as
strings, and it was terribly slow indeed.



_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to