[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: kwrite: CachedFontMetrics - big speedup
From:       Cullmann Christoph <crossfire () babylon2k ! de>
Date:       2001-02-28 17:33:03
[Download RAW message or body]

Thanks for the nice patch, seems to work well.

cu
Christoph Cullmann


Am Mittwoch, 28. Februar 2001 14:46 schrieb Martin Schenk:
> The last big performance problem in kwrite is the use of
> QFontMetrics::width to calculate the width of characters.
>
> I implemented a class CachedFontMetrics, inheriting from
> QFontMetrics, that caches the width of characters.
>
> For memory efficiency, this class allocates memory by
> Unicode-Row (256 characters) - ASCII text only needs
> row 0, so only that is allocated. When using other character
> sets, the needed rows are dynamically allocated.
>
> Using this class, changing the font from "courier new"
> to "arial" on 800K text takes less than 1 second, compared
> to about 10 seconds the old way. As this example shows,
> this speedup also works with proportional fonts, in contrast
> to the (currently unused) Attribute::width speedup.

["kwattribute.h" (text/x-c)]


["kwattribute.cpp" (kwattribute.cpp)]


>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic