If a map contains very many features then performing such operations as displaying themes, selecting features and some others, can take considerable time. One of “bottlenecks” reducing the system performance is accessing GDB files which contain all data on map features.
Data caching is a usual method of increasing program performance in such situations. Caching means storing in the main memory of those data read from a disk for which the probability of repeated access is high. Well planned caching can reduce the number of disk access operations in many times, which results in considerable acceleration of a program.
In the chapter 7 “GDB properties” the caching of GDB pages was described. This kind of caching affects the efficiency of all operations with GDB noticeable, but it is not aimed especially at the support of the operations of displaying maps and selecting features. To accelerate these operation more significantly, caching of features in map layers can be used, which is described below.
It is to be emphasized that caching does not affect the results of operations and is used only to increase performance. So those users who do not experience problems with operation speed when displaying maps, can skip following text up to the next chapter.
Caching inevitably results in increasing main memory consumption, and memory over-expenditure can cause slowing down the program functioning instead of expected acceleration. To provide the user with a possibility to make more flexible decisions, feature caching is set not for the map in whole, but for map layers. It is advisable to switch caching on, in the first turn, for layers containing not so many features which are intensively selected or used as arguments in spatial filter conditions (see chapter 35 “Using spatial properties of features in filters”). Among such layers particularly often are work layers of themes (see chapter 14 “Cataloged themes”, subsection “Work layers of a theme”).
For every layer of a map one of two feature caching modes (or both modes) can be set.
Preloading. If this mode is on, then, when opening theme browsing window for a component including the layer, reading data on all features is performed into the cache buffer created for this purpose.
All features of the layer are placed in the buffer, not only those features which fall into the displaying fragment of the opened theme. As a result, a certain delay can occur when opening a theme with many features, and the cache buffer can occupy a large extent of the main memory. Instead, thereafter all operations with the layer's features (their selecting, redisplaying in case of changing fragment, using in filter conditions etc.) will be performed much faster because there will be no need to access a disk for their executing.
If in the course of editing some new features are added or existing features are modified, they may not to get to the cache buffer (unless the mode of dynamic caching is also on) and their access will cause reading from disk each time.
On shared access of several users with the same GDB, full reset of the layer's cache buffer can happen in some situations. In this case, if the preloading mode is on then repeated reading of features into the buffer will be performed. It can result in a certain pause when executing next operation of selecting, filtering or theme displaying.
Dynamically. In this mode features are placed into the cache buffer when accessing them. The buffer is empty after the theme browsing window is open (unless the preloading mode is also on). The features are placed into the buffer when they are selected or used as filter condition arguments. On subsequent work with the theme, accessing features placed in the buffer will be performed without additional reading from disk.
So, this mode is more efficient in memory spending and it does not cause delay on the initial displaying, but it accelerates working with theme's features to a lesser degree. The acceleration will be achieved only on repeated performing operations with those features which was used before.
The greatest degree of acceleration can be achieved by combined using both modes, but in this case the greatest amount of the main memory will be occupied.
If the cache buffer of the layer's features is created, its use continues till working session with ObjectLand is over. The system does not provide for a possibility of early releasing the buffer. In the case when another theme is opened which include a layer for which the buffer is already created, the features in the buffer will be used whether the caching is on or off for this theme. However, if the dynamic caching mode is off, then adding features into buffer will not be performed.