Bug 87175

Summary: Application::GetSettings() takes a long time to run
Product: LibreOffice Reporter: Chris Sherlock <chris.sherlock79>
Component: sdkAssignee: Chris Sherlock <chris.sherlock79>
Status: RESOLVED INVALID    
Severity: normal    
Priority: medium    
Version: Inherited From OOo   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:

Description Chris Sherlock 2014-12-10 00:33:32 UTC
Application::GetSettings() takes quite a lot of time to run, making startup of LibreOffice take longer than necessary. On my VirtualBox instance (which is admittedly slow), the startup time for my new metafile viewer demo can take just under 30 seconds to load. 

I did some quick profiling, and it looks like Application::GetSettings() is the culprit, and in particular the slowdown appears to be in StyleSettings.
Comment 1 Chris Sherlock 2014-12-10 01:27:53 UTC
Got it - the issue is the DefaultFontConfiguration constructor. On my VM it is taking about 22 seconds, where the total load time is just over 28 seconds!
Comment 2 Chris Sherlock 2014-12-10 02:00:45 UTC
Strike... it's Components::getSingleton() that's taking the time!
Comment 3 Chris Sherlock 2014-12-10 02:53:35 UTC
This is an issue deep inside the way that we get the Component singleton the very first time. We basically parse every config file we can find, which takes forever.
Comment 4 Chris Sherlock 2014-12-10 02:58:17 UTC
Issue is in here:

configmgr/source/configurationprovider.cxx - function is Service::createInstanceWithArguments()

calls on:

Components::getSingleton() - this function is in configmgr/source/components.cxx

That calls on a static Component theComponentsSingleton, which invokes Component::Component - this parses every config file known to man. 

Profiling of the way that it handles the configuration could potentially speed up LO startup.
Comment 5 Chris Sherlock 2014-12-10 03:00:06 UTC
This is actually an SDK issue - configmgr is the problem here.
Comment 6 Chris Sherlock 2014-12-10 11:28:16 UTC
Methinks that I need to look into this later. Probably a combination of the way I'm compiling and using all languages.