Re: Performance enhaments for Abiword STABLE

From: Ryan Pavlik <abiryan_at_ryand.net>
Date: Thu May 17 2007 - 14:33:19 CEST

Didn't get a chance to look at the code, but I do have one major first
impression.

Jordi Mas wrote:
> <snip>
>
> * gr_Win32Graphics.cpp
>
> Checking what is the default printer was taking 0.18s (done 5 times at
> startup) when the default printer value is no really used.
THANK YOU! The dependency of word processor startup on speed of printer
access has been a small pet peeve of mine, and I didn't realized that it
could be removed like this. This takes _far longer_ than .18s (I am
guestimating) on systems with their default printer as a network
printer: even Word takes 30s to start up on a system like that while it
will take just 5-10 without a network printer.

My guess is also the less we poke printer drivers the less likely we are
to crash - it seems they are notoriously buggy.

Ryan
>
> * ut_Xpm2Bmp
>
> Called 59 times at startup. Increasing the default size of the hashmap
> to 256
> avoids 63 re-organizations of the hash. Saves 0.02s in my machine.
>
> * xap_Prefs.cpp, XAP_PrefsScheme::getNthValue (multiplatform)
>
> Everytime that we do a XAP_PrefsScheme::getNthValue the keys are sorted.
> Resulting in 144 calls to qsort at startup. Now, the list is stored
> once and
> keep it in a hash and invalidated when need it. Saves 0.23s in my
> machine.
>
> * ap_Strings.cpp, AP_DiskStringSet::setValue (multiplaform)
>
> Everytime that the setValue was called we where doing a lineal
> search. Loading the Catalan strings was doing 1.624.224 interations of
> the
> search. The same for XAP_DiskStringSet::setValue. Now, we use a hash.
>
> This decreases from around 8.8 seconds loading Abiword with an
> international
> string set in my machine to 0.6 seconds (when using the built-in
> string this
> is not called).
>
> * ap_Toolbar_Icons.cpp, _findIconNameForID and _findIconDataByName
>
> Instead of doing linear search we use now binary searches. That has
> reduced
> the time from 0.12s to 0.05s in my machine. We should keep the lists
> sorted.
>
> In my Windows box with Pentium 4 1.30Ghz the total time for loading
> Abiword
> went down from 8.6 seconds to 1.1.
>
> In a laptop with Ubuntu 7.1 with Intel Centrino Core Duo 2GB of cache at
> 1.86Ghz and 2GB of RAM the time decreased from 0.530s loading Abiword
> to 0.458s.
>
> I believe that difference between the differences in performance gains
> are due
> to the processor cache. In the old Pentium 4 probably the cache is
> hardly use
> and in the new Centrino Core is used.
>
> Any feedback, comments or results are welcome. It will be interesting
> to see
> the gains in your machines.
>
> For those lazy to re-compile the win32 build the one with the
> performance patch applied is at:
> http://www.softcatala.org/~jmas/files/AbiWord.zip
>
> Attached the patch.
>
> Regards,
>
Received on Thu May 17 14:32:21 2007

This archive was generated by hypermail 2.1.8 : Thu May 17 2007 - 14:32:22 CEST