Bug 78594 - Attached design win 13MB Mingliu embedded font takes 43secs GfxFont::readEmbFontFile to complete
Summary: Attached design win 13MB Mingliu embedded font takes 43secs GfxFont::readEmbF...
Status: RESOLVED WORKSFORME
Alias: None
Product: poppler
Classification: Unclassified
Component: splash backend (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-12 08:36 UTC by Paul Gruzdev
Modified: 2017-01-16 18:32 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Paul Gruzdev 2014-05-12 08:36:07 UTC
Probably because of small realloc increment size, GfxFont::readEmbFontFile takes painfully slow to complete. The font is Mingliu, it's embedded, it's size is 13MB, but still...
Comment 1 Paul Gruzdev 2014-05-12 08:42:05 UTC
File is too big - it can be downloaded here: https://drive.google.com/file/d/0BxCcB4V7CT9mdzJuYnM2dVMwdDg/edit?usp=sharing
Comment 2 Albert Astals Cid 2014-05-12 18:43:04 UTC
43 secs? on which hardware/OS?

it renders in 472msec here.
Comment 3 Paul Gruzdev 2014-05-13 13:38:04 UTC
Hi Albert!

I have a Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz, 4GB, Win7SP1 x64 build, my poppler build is also x64. The render code that I use is the following:
--------------------------------------------
	SplashColor bgColor;
	bgColor[0] = bgColor[1] = bgColor[2] = 255;
	SplashOutputDev splash(splashModeXBGR8, 4, gFalse, bgColor, gTrue, gTrue, splashThinLineDefault, gFalse);

	splash.setVectorAntialias(gTrue);
	splash.setFreeTypeHinting(gTrue, gTrue);

	splash.startDoc(pDoc);      

	pDoc->displayPageSlice(&splash, iPage, 72, 72, 0, false, true, false, -1, -1, -1, -1);
--------------------------------------------

note XBGR8 mode. Could that be the case, or x64 build? I can produce more precise profiling measures if you like.
Comment 4 Albert Astals Cid 2014-05-13 13:53:04 UTC
Windows? Try it on Linux
Comment 5 Albert Astals Cid 2017-01-16 17:14:40 UTC
He didn't come back to us, let's assume he found out what was wrong.
Comment 6 Paul Gruzdev 2017-01-16 18:32:56 UTC
Yes, I manually changed the call in GfxFont::readEmbFontFile to

buf = (char*)str->toUnsignedChars(len, 65536, 65536);

and it became much faster.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.