Re: Performance enhaments for Abiword STABLE

From: Tomas Frydrych <tf_at_o-hand.com>
Date: Thu May 17 2007 - 17:35:40 CEST

Hi Jordi,

Jordi Mas wrote:
> Hello Tomas,
>
>> The printer DC is needed to achieve a WYSIWYG layout. If you remove the
>> initialization, the document will be laid out using the screen font
>> metrics, and when you print it, the printed layout will be significantly
>> different, as it used to be in the old days. (Not sure what made you
>> think this value is not used, as it is used immediately on the next
>> line, and throughout the class, as well as in the derived USP class).
>
> You are complete right.
>
>> Some time could be saved by having a static member s_defaultPrinterDC
>> which would be initialised only once and used to initialize the
>
> Yes, that makes sense. I will do that for the next version of the patch.

Just wondering if it would not make sense to actually cache it somewhere
else so that the speed up would be for UT_getDefaultPrinterDC()
function. The main problem with caching it is what happens when the user
changes the default printer while AbiWord is running (not a huge deal,
probably), or worse, uninstalls it. We also, we need to be careful not
to delete the shared DC, probably some ref counting is needed here.

> CreateDC is very slow in this context. See the attached profiler graphic
> for details on the UT_GetDefaultPrinterDC call.

Thanks (and also for the patch).

Tomas
Received on Thu May 17 17:34:49 2007

This archive was generated by hypermail 2.1.8 : Thu May 17 2007 - 17:34:49 CEST