[Qgis-developer] QGIS slow on startup - Tests conclusions and questions

Régis Haubourg regis.haubourg at eau-adour-garonne.fr
Fri Jan 23 02:45:33 PST 2015


Hi all, 
I have been facing slowness of QGIS startup process on windows citrix
servers here, with no clue for months on what explained that phenomenon. I
faced first startup of 2 minutes,sometimes 15 minutes when servers where
loaded. Second startup takes generally 40 seconds. 

After 2 days of intensive testing and process monitoring, it's time to share
conclusions and see if QGIS community can do something to speed up things:

Conclusions on all platforms normal startup time seems mainly slowed down by
plugin loading:
- OSGEO4w package with grass, qgis, and some libs (numpy, scipy..) has more
than 9000 python files. On each startup, they get recompiled, which is a
consuming task and slow. Processing already packages only pyc files.  I
tested dropping all py files in OSGEO4W with success. 

- Could we drop all QGIS python sources in binaries, and suggest OSGEO4w to
do the same? We would save a good bunch of seconds on startup and distribute
ligther packages that way. Opinions? 

I also saw that it is possible to optimize compilation process to compile
pyo files and not pyc. No idea how much that can improve loading time, that
may be worth a try.

Conclusion only for Windows relative to first startup time :

-Windows gets a caching mecanism called cold/warm startup . see [0]
Microsoft provides optimization tips :
   - make a splashscreen ! we have that, but that sounds like a joke giving
this as first tip !
   - make less I/O on startup. I'm sure we can clean up things a bit. 
Process monitor shows lots of unnecessary file reading attempts (checks
several path for QGIS2.ini, even after successfull reading, check for python
files in parent dir of actual python file, QGIS.ini I/O on each new
action..) 
   - optimize module loading.. it's worth checking what's actually loaded. 
   - Defer initialization operations. Again, .ini seems stressed a lot in
whole startup process, I think we can do better. Caching ini? 
   - .Net apps have other tricks (ngen disk images) that are not applicable
to us.. 

Searching google for "QT cold startup" shows that we are not alone with that
issue. I'm unfortunatly not able to understand all that stuff. Hope it
helps.

[0] https://msdn.microsoft.com/en-us/library/cc656914%28v=vs.110%29.aspx




--
View this message in context: http://osgeo-org.1560.x6.nabble.com/QGIS-slow-on-startup-Tests-conclusions-and-questions-tp5183332.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.


More information about the Qgis-developer mailing list