Return-Path: X-Original-To: apmail-pdfbox-users-archive@www.apache.org Delivered-To: apmail-pdfbox-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AB22418E94 for ; Sat, 14 Nov 2015 13:51:37 +0000 (UTC) Received: (qmail 99020 invoked by uid 500); 14 Nov 2015 13:51:37 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 98995 invoked by uid 500); 14 Nov 2015 13:51:37 -0000 Mailing-List: contact users-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@pdfbox.apache.org Delivered-To: mailing list users@pdfbox.apache.org Received: (qmail 98983 invoked by uid 99); 14 Nov 2015 13:51:36 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Nov 2015 13:51:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 5F3BB180A20 for ; Sat, 14 Nov 2015 13:51:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.771 X-Spam-Level: * X-Spam-Status: No, score=1.771 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id dXsGKLh34GmT for ; Sat, 14 Nov 2015 13:51:30 +0000 (UTC) Received: from mailout02.t-online.de (mailout02.t-online.de [194.25.134.17]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id C655E20751 for ; Sat, 14 Nov 2015 13:51:29 +0000 (UTC) Received: from fwd09.aul.t-online.de (fwd09.aul.t-online.de [172.20.27.151]) by mailout02.t-online.de (Postfix) with SMTP id 042D926F431 for ; Sat, 14 Nov 2015 14:51:21 +0100 (CET) Received: from [192.168.2.104] (r3O64UZBghEzCsK9KS0NSFgHsuN+RdkMWTkck+vguSdYD7a+eXIoc11+-AsrcZLg7r@[217.231.132.234]) by fwd09.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1ZxbEZ-0iIWUC0; Sat, 14 Nov 2015 14:51:15 +0100 Subject: Re: Performance Issue with 2.0.0 SNAPSHOT latest builds To: users@pdfbox.apache.org References: <1447346746.15721.ezmlm@pdfbox.apache.org> From: Tilman Hausherr Message-ID: <56473C9B.8050906@t-online.de> Date: Sat, 14 Nov 2015 14:52:27 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-ID: r3O64UZBghEzCsK9KS0NSFgHsuN+RdkMWTkck+vguSdYD7a+eXIoc11+-AsrcZLg7r X-TOI-MSGID: a7ada48e-bc5e-428a-8702-956bc19f6c85 Am 14.11.2015 um 14:31 schrieb Sridhar So: > Dear PDFBox team > > Thanks for your response to below query. > > I set the Java property value pdfbox.fontcache to JDK lib directory where fonts are ther ( D:\\Softwares\\Java\\jre7\\lib\\fonts ). > I set the java property within the code before PDFBox API calls using > System.setProperty("pdfbox.fontcache", "D:\\Softwares\\Java\\jre7\\lib\\fonts") ; Don't do that, you may not have writing rights there. In your case "doing nothing" is best, i.e. that the file .pdfbox.cache is written in "C:\Users\Rangarajan" (if that is *your* home directory). > First time execution it took 140sec and created the cache file .pdfbox in the given directory > Subsequent time it took same 24 to 60 secs and no improvement in performance. > The difference noticed was, earlier .pdfbox file was created in user.home directory, now given directory but on performance side no noticable difference. > > My OS is MS Windows 7 home basic, since the user id has admin privilage, did not have admin issue. > In another machine/work machine with admin user id/prvilage, PDFBox could create font cache, but the performance was slow ( 30 sec + ) > > We use only Ariel and Time New Roman. > If the default font is chosen as Ariel in 1.8.10 code, that should be fine as 1.8.10 has performance, but fonts are lighter. > Alternatively if 2.0.0 is optimized for performance, that will be great. > > FYI > PDF file ( redireting the print to MS XPS Printer type file ), the size of PDF file generated in 1.8.10 is about 151 KB, whereas the size of PDF file created using 2.0 is 1152 KB ( about 10 times larger ). Maybe anti-aliasing. We have observed problems printing with some files, don't know if this applies to you. See here: https://issues.apache.org/jira/browse/PDFBOX-3046 See the first comment by John Hewson. About this: "Getting 13 to 19 seconds in 1.8.10, whereas in 2.0.0SNAPSHOT builds 22 to 36 seconds" That is very slow. It would be interesting to have a look at the PDF file. If you can, please upload it somewhere. Or send it to me (tilman at snafu dot de) and clarify what confidentiality you want (e.g. delete after a week, allow to pass to other committers, whatever). Try also view it with PDFDebugger command line utility in 2.0, or PDFReader in 1.8. Is display also slow? https://pdfbox.apache.org/1.8/commandline.html https://pdfbox.apache.org/2.0/commandline.html Tilman > It job.print() which takes lot of time. Time profile output below > > System.getproperty of pdfbox.fontcache = D:\Softwares\Java\jre7\lib\fonts > System.getproperty of user.home = C:\Users\Rangarajan > Nov 14, 2015 6:58:22 PM org.apache.pdfbox.cos.COSDocument finalize > WARNING: Warning: You did not close a PDF Document > PDDocument load time = 30ms PrinterJob creation time = 10ms job.setPageable ( new PDFPageable(pdDocument) time = 0ms job.print(); Printing Time = 58129ms Total time = 58.169 seconds > > > > Regards > Sridhar Sowmiyanarayanan > Tata Consultancy Services > Website: http://www.tcs.com > ____________________________________________ > Experience certainty. IT Services > Business Solutions > Consulting > ____________________________________________ > > > -----Sridhar So/BLR/TCS wrote: ----- > To: users@pdfbox.apache.org > From: Sridhar So/BLR/TCS > Date: 11/14/2015 01:36AM > Cc: users-owner@pdfbox.apache.org > Subject: Performance Issue with 2.0.0 SNAPSHOT latest builds > > Subject line changed. > > > Sridhar Sowmiyanarayanan > Tata Consultancy Services > Website: http://www.tcs.com > ____________________________________________ > Experience certainty. IT Services > Business Solutions > Consulting > ____________________________________________ > > > -----Sridhar So/BLR/TCS wrote: ----- > To: users@pdfbox.apache.org > From: Sridhar So/BLR/TCS > Date: 11/14/2015 01:32AM > Cc: users-owner@pdfbox.apache.org > Subject: Re: Returned post for users@pdfbox.apache.org > > Dear PDFBox Developers/Contributors > > > Thanks for reply, I tested with latest SNAPSHOT builds > https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/preflight-app/2.0.0-SNAPSHOT/ ------> build 1823 > https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/2.0.0-SNAPSHOT/ ---------> build 1800 and 1801 > Font cache rebuild is not happening every time and it is able to use from local store, however build 1800 & 1801 requires Admin privilage. > Compared to PDFBox version 1.8.10, 2.0.0 SNAPSHOT builds performance is slow ( 1.8.10 about 13 seconds, but 2.0.0 SNAPSHOT 1800, 1801 takes 30 seconds. ) > > Measured the time difference between 1.8.10 and 2.0.0 SNAPSHOT builds with following code > Getting 13 to 19 seconds in 1.8.10, whereas in 2.0.0SNAPSHOT builds 22 to 36 seconds > > long t1 = System.currentTimeMillis() ; > pdDocument = PDDocument.load(is); > long t2 = System.currentTimeMillis() ; > PrinterJob job = PrinterJob.getPrinterJob(); > job.setPageable(new PDFPageable(pdDocument)); // Version 2.0.0 SNAPSHOT builds > //job.setPageable(new PDPageable(pdDocument)); // Version 1.8.10 > job.print(); > long t3 = System.currentTimeMillis() ; > //printWithPaper(pdDocument, "A4") ; > System.out.println ( " PDDocument load time = " + > String.valueOf(t2 - t1) + " Printing Time = " + String.valueOf(t3-t2 ) + > " Total time = " + String.valueOf( (t3 - t1)/1000.0 ) + " seconds " ) ; > > > > Do we have > Performance fix available in 2.0.0 SNAPSHOTS, if so please give full path and which build? > Is there a fix available where Admin privelage is not required? > Thanks a lot for your reply in advance. > > FYI > ---- > Alignment issue is still there in 2.0.0 and my attempt to adjust alignment using below code takes lot of time. > > PageFormat pageFormat = new PageFormat(); > pageFormat.setOrientation(PageFormat.PORTRAIT); > Paper paper= pageFormat.getPaper(); > > if ("SLEEK".equalsIgnoreCase(receiptType)) { > paperWidth = 3.14; > paperHeight = 50; > } else if ("LETTER".equalsIgnoreCase(receiptType)) { > paperWidth = 8.5; > paperHeight = 11; > } else if ("LEGAL".equalsIgnoreCase(receiptType)) { > paperWidth = 8.5; > paperHeight = 14; > } > else > { > paperWidth = 8.3; > paperHeight = 11.7; > } > > paper.setSize(paperWidth * 72.0, paperHeight * 72.0); > paper.setImageableArea(-2000, 0, paper.getWidth(), paper.getHeight()); > pageFormat.setPaper(paper); > > > PrinterJob job = PrinterJob.getPrinterJob(); > job.setPageable(new PDFPageable(document));� > > � � � � Book book = new Book();� > book.append(new PDFPrintable(document), getPageFormat(receiptType) , document.getNumberOfPages());� > > job.setPageable(book);� > job.print(); > > > Regards > Sridhar Sowmiyanarayanan > Tata Consultancy Services > Website: http://www.tcs.com > ____________________________________________ > Experience certainty. IT Services > Business Solutions > Consulting > ____________________________________________ > > > > > > - > > To: users@pdfbox.apache.org > cc: commits@pdfbox.apache.org > Subject: Re: Speedup Font Cache: Performance Issue in PDFBox 2.0.0-RC1 > > Dear PDFBox Community > > Adding Commits, John and Tilman in the mail request > > Details are in below mail. > > In brief again > > In our system, PDF files generated in server and is sent to client and in client applet code uses PDFBox to print. > With PDFBox 1.8.10, we have alignment issue as some characters were missing on left side. > With PDFBox 2.0.0-RC1, we have faced performance issue ( slow ) > > Do we have fix or patch available� > either in 2.0.0-RC1 for performance �OR > alignment issue in 1.8.10 > Our PDF documents uses True Type Fonts, mostly Ariel Unicode > > Thanks a lot for your help and support. > > Regards > Sridhar Sowmiyanarayanan > Tata Consultancy Services > Website: http://www.tcs.com > ____________________________________________ > Experience certainty. IT Services > Business Solutions > Consulting > ____________________________________________ > > > -----Sridhar So/BLR/TCS wrote: ----- > To: users@pdfbox.apache.org > From: Sridhar So/BLR/TCS > Date: 11/12/2015 06:23PM > Subject: Speedup Font Cache: Performance Issue in PDFBox 2.0.0-RC1 > > Dear PDFBox Developers/Contributors > > I am unable to subscribe to users mailing list as the link tries to open Outlook not the page to subscribe, hence a seperate mail on similar/same issue discussed. > > Issue: > -------� > PDFBox2.0.0-RC1 is very slow in printinng ( taking 35 to 50 seconds ) �as it tries to load fonts each time with the following message > > WARNING: New fonts found, font cache will be re-built > Nov 12, 2015 3:17:26 PM org.apache.pdfbox.pdmodel.font.FileSystemFontProvider > WARNING: Building font cache, this may take a while > Nov 12, 2015 3:17:32 PM org.apache.pdfbox.pdmodel.font.FileSystemFontProvider saveCache > WARNING: Finished building font cache, found 522 fonts > > > Is the fix or patch available to avoid slow performance due to above ( rebuilding font cache �every tme ) ?� > If the fix not available in 2.0.0-RC1,�Is there any way to fix alignment issue in PDFBox 1.8.10? as 1.8.10 left margin is too low and first few characters are found cut in printout. > > With PDFBox1.8.10, there is no performance issue, but alignment in prontout is not proper. �� > With PDFBox 2.0.0-RC1, we are facing performance issue. > > PDFDocument used has Ariel �Unicode or True Type Fonts.� > > Similar discussion thread is pasted below, as I was unable to reply to same discussion thread, nor able to subscribe to users mailing list, hence a seperate mail. > > Regards > Sridhar > > Subject: Re: Speedup Font Cache > From: John Hewson (jo...@jahewson.com) > Date: Oct 21, 2015 5:26:41 pm > List: org.apache.pdfbox.users > > On 21 Oct 2015, at 09:43, Maruan Sahyoun wrote: > > Hi, > > Am 21.10.2015 um 18:40 schrieb Tilman Hausherr : > > Am 21.10.2015 um 14:10 schrieb Roberto Nibali: > Hi John > > On Wed, Oct 21, 2015 at 12:35 AM, John Hewson wrote: > > Yes, I’m able to replicate that issue on Windows. It’s apparently related > to administrator ownership of that registry key’s parent node. Looks like > it’ll be necessary to log in as admin and create that key with user access. > I guess that’s far from ideal? > > The whole issue also happens on MacOSX. When you introduce this on-disk > cache a couple of months back, it worked fine, however one of the recent > changes to SVN must have wrecked the initially intended functionality. Not > only is the font caching setup 5-10 times as long as it used to be, it also > does not seem to persist it anymore. Version used: > > $ svn info | grep -i changed > Last Changed Author: tilman > Last Changed Rev: 1709647 > Last Changed Date: 2015-10-20 19:04:02 +0200 (Tue, 20 Oct 2015) > > Running my test tool indicates: > > Oct 21, 2015 2:08:29 PM > org.apache.pdfbox.pdmodel.font.FileSystemFontProvider loadCache > WARNING: New fonts found, font cache will be re-built > Oct 21, 2015 2:08:29 PM > org.apache.pdfbox.pdmodel.font.FileSystemFontProvider > WARNING: Building font cache, this may take a while > Oct 21, 2015 2:08:39 PM > org.apache.pdfbox.pdmodel.font.FileSystemFontProvider saveCache > WARNING: Finished building font cache, found 654 fonts > [INFO, ctx=./ccalt.pdf]: Opening Source ./ccalt.pdf > [INFO, ctx=./ccalt.pdf]: Opening Template ./cctemp.pdf > [INFO, ctx=./ccalt.pdf]: Writing Output ./ccmig.pdf > [INFO, ctx=./ccalt.pdf]: Completed in 15037.02ms > > This used to be anything between 1200ms and 2300ms and once it was > persisted onto disk, it was rather fast in subsequent calls. Unfortunately, > SVN does not provide the handy tool of "git bisect" to quickly find out > which change actually caused this regression. > > There were only 4 changes since then, so it might be worth a try to just revert > that file. > > (I can't help; for me, it has always been slow.) > > Could it be that 1) you installed new stuff on your computer, 2) that MacOS has > many of its fonts in .ttc files? In Windows there are only 10. > > on my OS X I have 92 ttc files (out of 384) :-) > > Yep, OS X uses ttc much more heavily than Windows and some of those are big > Asian fonts which PDFBox parses relatively slowly. > > — John > > BR > Maruan > > Tilman > > Let me know if you need any further input. > > Cheers > Roberto > > > > Regards > Sridhar Sowmiyanarayanan > Tata Consultancy Services > Website:�http://www.tcs.com > ____________________________________________ > Experience certainty. IT Services > Business Solutions > Consulting > ____________________________________________ > =====-----=====-----===== > Notice: The information contained in this e-mail > message and/or attachments to it may contain > confidential or privileged information. If you are > not the intended recipient, any dissemination, use, > review, distribution, printing or copying of the > information contained in this e-mail message > and/or attachments to it are strictly prohibited. If > you have received this communication in error, > please notify us by reply e-mail or telephone and > immediately and permanently delete the message > and any attachments. Thank you > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org