Opened 13 years ago

Last modified 13 years ago

#3200 new enhancement

Feature cache

Reported by: wonder Owned by: wonder
Priority: major: does not work as expected Milestone: Version 1.7.0
Component: Vectors Version:
Keywords: Cc:
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

Description

It would be nice to have caching of features within vector layers. With caching, we could speed up the rendering by not fetching the data from (slow) data source on every render and store the features for some time in the memory.

Attached patch has been developed about more than one year ago as a first attempt to add this functionality to QGIS. It will have to be modified in order to be usable with current svn trunk. It has been shown with the patch that 2x speed up can be achieved (and maybe more). The patch also needs more testing / improvements as it modifies various areas within the core.

Attachments (1)

featurecache_patch.diff (120.1 KB ) - added by wonder 13 years ago.
initial patch (probably not working with current trunk anymore)

Download all attachments as: .zip

Change History (5)

by wonder, 13 years ago

Attachment: featurecache_patch.diff added

initial patch (probably not working with current trunk anymore)

comment:1 by wonder, 13 years ago

Component: Build/InstallVectors
Owner: changed from nobody to jef
Platform: DebianAll

comment:2 by wonder, 13 years ago

Owner: changed from jef to wonder

comment:3 by wonder, 13 years ago

It should be also noted that this patch has been developed by Andrej Krutak (not me!) within qgis-mapper project.

Some notes for the author:

  • The "Cache nothing" option completely disables caching and features are always retrieved from data provider.
  • The "Heuristics" option keeps reasonable amount of features in memory, by releasing some of them when the current extent is much smaller than the cached area.
  • The "Cache all layer's features" option allows cache to store all features displayed. This doesn't neccesarily mean that all vector layers' data will be cached - once the cache is enabled, it only holds features from the biggest extent displayed (i.e. if user zooms-out, and required data are superset of the currently cached data extent - the cache is freed and refilled with the superset data - which are of course read from the data provider). Also, if user moves current extent, so that the already cached extent only partially overlaps with the new one, the previous data will be released and the new extent cached. This "filling behaviour" is the same as the one of "Heuristics" option.

comment:4 by trapanator, 13 years ago

this could be a very useful fix!

Note: See TracTickets for help on using tickets.