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 D261117E1F for ; Wed, 21 Oct 2015 23:24:24 +0000 (UTC) Received: (qmail 20025 invoked by uid 500); 21 Oct 2015 23:24:24 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 19999 invoked by uid 500); 21 Oct 2015 23:24:24 -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 19987 invoked by uid 99); 21 Oct 2015 23:24:24 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Oct 2015 23:24:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id A7254C446A for ; Wed, 21 Oct 2015 23:24:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.88 X-Spam-Level: ** X-Spam-Status: No, score=2.88 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id GVfcTRXvccoi for ; Wed, 21 Oct 2015 23:24:17 +0000 (UTC) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id AF6DE20FE0 for ; Wed, 21 Oct 2015 23:24:16 +0000 (UTC) Received: by wicll6 with SMTP id ll6so95886801wic.1 for ; Wed, 21 Oct 2015 16:24:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=46VzNtnSkyaw3sZ2gI2w7vE9vf3w4d9uhwWOPmYtnHk=; b=TVZQdNE8Wfrfkuc8RVrcvwdzaff7PRvSYfaFDURw9IcNv6PO2Re7HzSqIhF+dLNlux ZpoSVES44C7VoOJh3IL5L8ZlCJJ8kCzdjBuT/TViy/l/FXD1h/cyzj0bjQo3izsFV8uW jC8wEMMgcOBgU8TplzeaKf22MwQPqbuespwaNEOty0yNJD6sPGLu/oL39aDqEZzTYBcR 5K17fKe2SPk+iAdQZbpXQmWIE/Eg4/eVtYF1vmJH9O8e7asz8gIYNiQPflh0u9XlObtF zdHIrDk5vm+QZ0dVtDj9/CPifyO8Ctf2LW6yiF/xvaGogqgLVn9gnYtQrQ+UrDnn2PNn p3kA== X-Received: by 10.180.24.42 with SMTP id r10mr11501608wif.46.1445469855491; Wed, 21 Oct 2015 16:24:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.165.205 with HTTP; Wed, 21 Oct 2015 16:23:56 -0700 (PDT) In-Reply-To: References: <5626464C.1080002@mail.de> <56265293.1090706@mail.de> <5627BFEA.80400@t-online.de> <5627CA51.5010409@t-online.de> From: Roberto Nibali Date: Thu, 22 Oct 2015 01:23:56 +0200 Message-ID: Subject: Re: Speedup Font Cache To: users@pdfbox.apache.org Content-Type: multipart/alternative; boundary=f46d043c807a452be90522a5ad6f --f46d043c807a452be90522a5ad6f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Addendum (fixed my one-liner): And no pfb fonts: $ shopt -s nocasematch; tot=3D0; pfb=3D0; ttf=3D0; otf=3D0; ttc=3D0; while = read line; do let tot+=3D1; case "${line##*.}" in ttf) let ttf+=3D1;; otf) let otf+=3D= 1;; ttc) let ttc+=3D1;; pfb) let pfb+=3D1;; esac; done < <(gfind /Library/Fonts /System/Library/Fonts ~/Library/Fonts -type f \( -iname "*.ttf" -o -iname "*.ttc" -o -iname "*.otf" -o -iname "*.pfb" \) 2>/dev/null -printf "%f\n") && printf "\nTotal fonts=3D%s: ttf=3D%s otf=3D%s ttc=3D%s pfb=3D%s\n" "$tot= " "$ttf" "$otf" "$ttc" "$pfb" Total fonts=3D447: ttf=3D296 otf=3D63 ttc=3D88 pfb=3D0 Cheers Roberto On Thu, Oct 22, 2015 at 1:15 AM, Roberto Nibali wrote: > Hi guys > > Well, a quick look revealed the following stats: > > $ ttf=3D0; otf=3D0; ttc=3D0; while read line; do shopt -s nocasematch; ca= se > "${line##*.}" in ttf) let ttf+=3D1;; otf) let otf+=3D1;; ttc) let ttc+=3D= 1;; > esac; done < <(gfind /Library/Fonts /System/Library/Fonts ~/Library/Fonts > -type f \( -iname "*.ttf" -o -iname "*.ttc" -o -iname "*.otf" \) > 2>/dev/null -printf "%f\n") && printf "ttf=3D%s otf=3D%s ttc=3D%s\n" "$tt= f" > "$otf" "$ttc" > > ttf=3D296 otf=3D63 ttc=3D88 > > So, not that many fonts that ought to be parsed by pdfbox. Since I > currently cannot verify an older version of pdfbox svn, may I ask what > could cause such a change? I have certainly installed new patches and > software to my MacOSX 10.9. > > Cheers > Roberto > > > On Wed, Oct 21, 2015 at 7:24 PM, Tilman Hausherr > wrote: > >> Am 21.10.2015 um 18:43 schrieb Maruan Sahyoun: >> >>> 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=E2=80=99m able to replicate that issue on Windows. It=E2=80=99= s apparently >>>>>> related >>>>>> to administrator ownership of that registry key=E2=80=99s parent nod= e. Looks >>>>>> like >>>>>> it=E2=80=99ll be necessary to log in as admin and create that key wi= th user >>>>>> access. >>>>>> I guess that=E2=80=99s 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, i= t >>>>> 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=3D./ccalt.pdf]: Opening Source ./ccalt.pdf >>>>> [INFO, ctx=3D./ccalt.pdf]: Opening Template ./cctemp.pdf >>>>> [INFO, ctx=3D./ccalt.pdf]: Writing Output ./ccmig.pdf >>>>> [INFO, ctx=3D./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 o= ut >>>>> 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 1= 0. >>>> >>> on my OS X I have 92 ttc files (out of 384) :-) >>> >> >> Oh. I forgot to mention why I asked that. My last change ignores ttc >> files in the cache, even deletes them, because the cache is one file =3D= > one >> ttf font, this resulted in ttf fonts being ignored the second time. So >> these ttc files would be parsed each time. >> >> Tilman >> >> >> >>> BR >>> Maruan >>> >>> Tilman >>>> >>>> >>>> Let me know if you need any further input. >>>>> >>>>> Cheers >>>>> Roberto >>>>> >>>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org >>>> For additional commands, e-mail: users-help@pdfbox.apache.org >>>> >>>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org >>> For additional commands, e-mail: users-help@pdfbox.apache.org >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org >> For additional commands, e-mail: users-help@pdfbox.apache.org >> >> > --f46d043c807a452be90522a5ad6f--