[poppler] splash output improvement
Albert Astals Cid
aacid at kde.org
Sat Nov 12 04:40:57 PST 2005
A Dijous 10 Novembre 2005 19:17, Carlos Fangmeier va escriure:
> Hi,
Hi
> I'm using the evince pdf reader, who use the poppler lib to do the
> render. I notice that the render of poppler ( using the splash output )
> is much slower than xdf. Maybe runing evince on a desktop pc isn'tt a
> big deal, but runing evince on a Zaurus C860 is to slow.
> Using valgrind-cachegrind on my pc I find out that most of the cpu used
> for rendering a pdf, was spend in the constructor
> SplashScreen::SplashScreen ( almost 38% ), so I decided to do some
> litle improvement. After my changes the cpu spend on this constructor
> dropped to 0.1%. With this improvement the evince response was much
> better than before.
> Attachedt to this mail is the patch with my changes, maybe they aren't
> 100% acording with your develope, but it could be a good idea.
> Basically I implemented a cache for all possible threshold matrix.
Hmm, this is C++, so i think having
SplashCoord **cache_mat;
int cache_count;
as static members of SplashScreen would be better, what do you think?
Also, i don't seem to understand the caching method much, let's say we first
call that contructor with 100, we would get
size2 = sizeA >> 1 // size2 = 50
size = size2 << 1; // size = 100
size1 = size +1; // size1 = 101
if( cache_count < size1 ) // true because cache_count stats at 0
{
// create a 101 SplashCoord * array
}
........
// end up using only the 100 position of that array, all else is empty
So would be better to just use a GooHash and not loose the other positions?
My other concern would be cache growing too much as you never seem to empty it
and that making it take too much mem but
$ grep -ri "new SplashScreen" *
splash/SplashScreen.h: SplashScreen *copy() { return new
SplashScreen(this); }
splash/SplashState.cc: screen = new SplashScreen(10);
says that we always use 10 as size for the SplashScreen so the cache is always
going to be of 1 element :-D
So can you try to rewrite the patch using a static GooHash as SplashScreen
member and see if it still works/gives you the same quickness?
Thanks.
Albert
>
> Best regards
>
>
> Carlos Fangmeier
>
>
> _____________________________
> La informacion contenida en esta transmision es confidencial, y no puede
> ser usada por otras personas que su(s) destinatario(s). El uso no
> autorizado de la informacion contenida en esta transmision puede ser
> sancionado. Si ha recibido esta transmision por error, por favor destruyala
> y notifique al remitente telefonicamente, con cobro revertido o via e-mail.
>
> The information contained in this transmission is privileged, and may not
> be used by any person other than its addressee(s). Unauthorized use of the
> information contained in this transmission may be punished by law. If
> received in error, please destroy and notify the sender by calling collect
> or by e-mail. _____________________________
______________________________________________
Renovamos el Correo Yahoo!
Nuevos servicios, mநூs seguridad
http://correo.yahoo.es
More information about the poppler
mailing list