[Qgis-developer] Implementing a cache for the composer attribute table

Marco Hugentobler marco.hugentobler at sourcepole.ch
Thu Apr 17 07:25:35 PDT 2014


Hi Nyall

It is a good idea to cache the provider results in the composer 
attribute table. Please apply the pull request.

There is no special reason for the current non-caching behaviour. It was 
fast enough for my usage when I implemented it back in 2010, so there 
was no reason for me to do caching.

Regards,
Marco

On 17.04.2014 14:54, Nyall Dawson wrote:
> Hi all,
>
> I've just sent a pull request (#1323) which implements a caching
> mechanism for the composer attribute table.
>
> Currently, the composer attribute table is very heavy with the cpu, as
> it refetches the attributes from the layer's provider with every
> paint. This is both expensive and potentially results in many
> duplicated calls to a database backend. This pull request implements
> an attribute cache for the table so that the attributes are only
> refetched when required (item properties change, vector layer emits
> layerModified, or when exporting the composition). The end result is
> that using composer tables no longer results in heavy cpu use and
> continual provider queries.
>
> I'm reluctant to merge this myself as I don't know the history behind
> the composer table, and why it was originally created to requery on
> every paint operation. Perhaps there's a valid reason for this which I
> may be missing? Can anyone shed any light on this and let me know if
> there's a use case I might be overlooking?
>
> Nyall
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


-- 
Dr. Marco Hugentobler
Sourcepole -  Linux & Open Source Solutions
Weberstrasse 5, CH-8004 Zürich, Switzerland
marco.hugentobler at sourcepole.ch http://www.sourcepole.ch
Technical Advisor QGIS Project Steering Committee



More information about the Qgis-developer mailing list