Bug 689025

Summary: CIDFont slowdown running the Quality Logic CET suite
Product: Ghostscript Reporter: leonardo <leonardo>
Component: ResourceAssignee: Ken Sharp <ken.sharp>
Status: RESOLVED WORKSFORME    
Severity: enhancement CC: alex, shailesh.mistry
Priority: P4 Keywords: bountiable
Version: 0.00   
Hardware: PC   
OS: Windows XP   
Customer: Word Size: ---

Description leonardo 2006-12-13 16:01:17 UTC
When Resource/CIDFont directory isn't empty, "/Font resourceforall" executes 
dramaticly slow. Detected with running all CET tests with ppmraw -r300. 355 of 
498 tests execute "/Font resourceforall". With empty directory the run of all 
tests completes in 50 minutes. When it contains 7 fonts, it takes 4+ hours. The 
fonts are :

HeiseiKakuGo-W5
HeiseiMin-W3
Munhwa-Bold
STFangsong-Light
STSong-Light
WadaGo-Bold
WadaMin-Regular
Comment 1 leonardo 2006-12-13 16:06:18 UTC
I meant running each test in another session.
Comment 2 leonardo 2007-08-29 20:48:19 UTC
IMO we need to inplement new special PS operators in C for supporting /Font 
resourceforall.
Comment 3 Ray Johnston 2008-12-15 08:59:54 UTC
Implementing in C is an enhancement.
Comment 4 Shailesh Mistry 2011-07-19 19:42:04 UTC
Enhancement still missing in Ghostscript 9.03
Comment 5 Ken Sharp 2013-12-02 00:57:55 UTC
I haven't tried the full set of CET tests, however I am unable to reproduce a gross slowdown by adding CIDFonts.

Running "(*) {==} 256 string /Font resourceforall" with no additional fonts takes 0.43 - 0.50 seconds. Adding a single CIDFot brings this up to 0.58-0.59. Adding 3 more CIDFonts (for a total of 4 additional CJK fonts) increases this to 0.86-0.92 seconds.

Given that we compose the CIDFonts to produce a number of possible Fonts, this doesn't seem unreasonable.

Testing one of the CET files (09-01.ps) we see that the resourceforall is only used in the Global Interference Test.  Adding 4 more CIDFonts didn't significantly increase the time for me. (0 fonts 0.39-0.41, 4 fonts 0.37-0.49)