Click here to load reader
Upload
ross-mcdonald
View
680
Download
4
Embed Size (px)
DESCRIPTION
Martin Dobias of Lutra Consulting explaining some of the performance enhancements coming in the next releases of QGIS including multi-threaded processing.
Citation preview
QGIS Performance Improvements
Scottish QGIS User GroupMarch 19th 2014
Martin DobiasLutra Consulting
Who are we?
● A group of consulting engineers specialising in:
● GIS (Open Source GIS)
● Software Development
● Numerical Modelling (in the water engineering sector)
Introduction to Python
About me
● With Lutra Consulting since autumn 2013
● Background in computer science
● Self-taught in GIS
● QGIS developer since 2005
● Python support
● Advanced symbology and labeling support
● Expressions
● Under the hood improvements (libraries, vectors, canvas, ...)
QGIS Performance Improvements
Performance Problems in QGIS
● DEMO
● Slow rendering
● Every map refresh can take several seconds with complex projects
● Rendering freezes user interface
● User has to wait with any actions until the rendering has finished
QGIS Performance Improvements
Rendering in QGIS (1)
QGIS Performance Improvements
Rendering in QGIS (2)
QGIS Performance Improvements
Parallelization
● Algorithms vary significantly in how parallelizable they are
● Embarrassingly parallel problems
● e.g. rendering of 3D scenes, serving static files from web server
● Inherently serial problems
● e.g. iterative numerical methods
QGIS Performance Improvements
Parallel Rendering in QGIS (1)
● Each layer rendered to a separate image, then composed together
● N-times faster!
● Framework to handle scheduling (QtConcurrent)
● Use all available CPU cores
● Automatic load balancing
QGIS Performance Improvements
Parallel Rendering in QGIS (2)
● Real world
● Speed improvement depends on data
● One complex layer may dominate total time → smaller speed improvement
● Lower waiting time with remote services → higher speed improvement
QGIS Performance Improvements
User Interface Freeze
● Application waits for events and handles them
● When busy, events need to wait to be processed
● Move the rendering to the background!
QGIS Performance Improvements
Rendering in Background
● Users may do some changes that affect rendering while rendering is still in progress
● e.g. change layer style, delete a layer
● Possible solutions:
● Do nothing
● Do not allow such actions
● Make sure all such actions are safe
QGIS Performance Improvements
Rendering in Background - Problems
● Data used for rendering must be protected from simultaneous access
● Complex task, needs to be addressed rigidly
● Locking
● Waiting
● If not done properly: dead-locks, crashes
● Copying
● May add overhead
● QGIS uses both locking and copying when appropriate
QGIS Performance Improvements
DEMO
QGIS Performance Improvements
Project History
● Summer 2010: Started as a Google Summer of Code (GSoC) project
● Spring 2013: Updates to QGIS infrastructure before the 2.0 release (API changes)
● Winter 2013: Implementation of the parallel/background rendering
● Spring 2014: Merged into QGIS master branch, will be in 2.4 release
QGIS Performance Improvements
Looking into the Future...
● Cancellation of raster data requests (needs also work in GDAL)
● Vector caching
● Faster labeling and vector reprojection
● Rendering with OpenGL
QGIS Performance Improvements
Summary
● QGIS 2.4 will be
● More interactive when browsing maps
● Able to use all available CPUs for rendering
● Q & A
QGIS Performance Improvements
Tips for Better Performance
● Vector layers: use spatial index
● Raster layers: use overviews
● Rendering configuration
● Turn on render caching
● Turn off anti-aliasing
● Vector styling
● Thin lines
● Polygons without border
● Without data-defined properties
● Data store specific features
● PostGIS – disable SSL mode on local network
QGIS Performance Improvements