[poppler] splash output improvement

Carlos Fangmeier carlos.fangmeier at sixbell.com
Mon Nov 14 05:07:37 PST 2005


Albert Astals Cid wrote:

>A Dijous 10 Novembre 2005 19:17, Carlos Fangmeier va escriure:
>  
>
>>Hi,
>>    
>>
>Hi
>  
>
Hi again :D

>  
>
>>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?
>
>  
>
I agree, my patch isn't a nice code :$ , but it give a idea where and 
how to improve the splash output.

>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
>}
>........
>  
>
Yes, thus it is how it works. It use the value of "size" as an index to 
go into the cache_mat and get the previously generated matrix.

>// end up using only the 100 position of that array, all else is empty
>  
>
The gain in speed was much better than the loose of that unused position 
in the array.

>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
>  
>
When I tested my patch, I dind't looked for all the places where one 
"new SplashScreen" was, but I saw that the value of size was allways 10, 
but I didn't know that this was the only value it would take. What is 
the meaning of this magic number?

>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 for the advice, I will look for it in the code, rewrite my code 
and test it again. I let you know the results.

>Thanks.
>
>  
>
Thanks you.

>Albert
>
>
>  
>
Carlos

>>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
>_______________________________________________
>poppler mailing list
>poppler at lists.freedesktop.org
>http://lists.freedesktop.org/mailman/listinfo/poppler
>
>
>  
>


_____________________________
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.
_____________________________


More information about the poppler mailing list