Hello, Just a small interesting follow up. For running the workload I posted before iText allocates a total of 18'637'142 StringBuffer instances. It is also needed a total of 4000 com.itextpdf.text.pdf.PRTokeniser instances one per com.itextpdf.text.pdf.PdfReader which is fine 2x2000: 2x (appendHeader + appendFooter) * 2000 (generatePdf calls) Only the allocation time for StringBuffer accounts for 4% of the total workload running time ... most of these allocations come from: com.itextpdf.text.pdf.PRTokeniser.nextToken() com.itextpdf.text.pdf.PRTokeniser.readString() I would really consider making StringBuffer, maybe even better StringBuilder a final attribute member of com.itextpdf.text.pdf.PRTokeniser and re-use the same instance and do the "reset" when needed i.e. call builder.setLength(0); http://java.sun.com/javase/6/docs/api/java/lang/StringBuilder.html#setLength%28int%29 Best regards, Giovanni ============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ==============================================================================
------------------------------------------------------------------------------
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
