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

Nyall Dawson nyall.dawson at gmail.com
Thu Apr 17 05:54:14 PDT 2014


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


More information about the Qgis-developer mailing list