> 1. PageWriter:
> Every time the convertToImage method is called there will be a new PageDrawer 
> created 
> and the parent class PDFStreamEngine loads the resource bundles.
>
> Why not use some kind of a cache for loading the bundles? (Load resources 
> just ones) 
It's a little bit complicated. As I understood, the resources contains the 
operator-class-mapping. Every entry will be linked to the PDFStreamEngine as 
some sort of callback-mechanism. Consequently every instance of a 
PDFStreamEngine needs its own mapping.

> Why not use one PageWriter for the whole document? (Just share it)
This could be done easily. 

> 2. PageWriter:
> Every time the convertToImage method is called there will be a new 
> BufferedImage+Graphics.
> (but not so expensive like Graphics2D.scale() ;))
>
> Why not reuse a BufferedImage for all pages? It is faster to call
> Graphics2d.fillRect() than creating a new one.
This is a litte bit complicated too. Within a pdf-document all pages may have a 
different size and orientation. So, thinking about oo-programming, only the 
class PDPage "knows" everything about the page, consequently PDPage has to 
provide the conversion to a image.

A this point the main questions is: did you ever implement your suggestions to 
compare the performance? Or, are these thoughts theoretical? Did you perhaps 
use some kind of a profiler?

I'm using this feature (convertToImage, printing) as well, and I don't have any 
serious performance-issues. But if there is some potential to speed up pdfbox, 
let's try to do it. But we have to compare the costs against the profit.


Greetings from rainy Essen just in the middle of the Ruhrpott ;-)
Andreas

2008/11/11 <[EMAIL PROTECTED]>

> Hi Daniel,
>
> don't hesitate, I guess your suggestions are welcome wether they will 
> included or not.
>
>
> Andreas
>
>
> -----Ursprüngliche Nachricht-----
> Von: Daniel Manzke [mailto:[EMAIL PROTECTED]
> Gesendet: Dienstag, 11. November 2008 12:49
> An: [email protected]
> Betreff: Performance Tuning
>
>
> Hi there,
> first I have to say:"Good job." It's really a nice project.
>
>
> I'm using the PDFBox for transforming PDF to Image. But I have some 
> performance issues, so I had a look at the source code. I saw several 
> points where I could save time. ;) Are you interested in them? I would 
> prefer that we could discuss about this, because maybe it is as 
> designed and my steps are dangerous.
>
>
>
> Best Regards,
> Daniel
>
> ----------------------------------------------------------------
> - Geschaeftsfuehrung: Chittur Ramakrishnan (Vorsitzender), Stefan 
> Niehusmann -
> - Sitz der Gesellschaft: Dortmund -
> - Eingetragen beim Amtsgericht Dortmund -
> - Handelsregister-Nr. HR B 21222 -
> - USt.-IdNr. DE 2588 96 719 -
>



-- 
Mit freundlichen Grüßen

Daniel Manzke

----------------------------------------------------------------
- Geschaeftsfuehrung: Chittur Ramakrishnan (Vorsitzender),
Stefan Niehusmann -
- Sitz der Gesellschaft: Dortmund -
- Eingetragen beim Amtsgericht Dortmund -
- Handelsregister-Nr. HR B 21222 -
- USt.-IdNr. DE 2588 96 719 -

Reply via email to