Maximizing performance in dynamic display


Summary This topic shows tips and tricks to get the most out of performance when using dynamic display in the ArcGIS framework.

In this topic


Improving performance when using dynamic display

Use the following tips and tricks to improve performance when working with dynamic display:
  • Use rasters as background layers—Rasters are considered cached datasets. Other data types, such as vectors and computer-aided design (CAD) datasets, are cached on demand. Rasters allow for changing display characteristics at run time (such as changing renderer, spatial reference, contrast, histogram stretching, and so on) without having to rebuild the cache. In addition, saving a dataset as a raster gives the option to easily distribute the cache without having to deal with a cumbersome file-based cache. Once a dataset is converted to a raster, it can be disconnected from the original dataset.
  • Remove unused layers—Check the table of contents (TOC) to ensure that your map document is clear of layers that are unrelated to the map's purpose.
  • Set scale-dependent rendering for data layers—Use scale-dependent rendering to ensure that unnecessary layers do not draw when the map is zoomed out. Data intensive or detailed layers might be more appropriate only when the map is zoomed in to a larger scale.
  • Use consolidated group layers—Consolidated group layers display faster than layers that are not consolidated.
  • Use annotation instead of labels—Since labels require the computer to make placement decisions, it is generally faster to use an annotation layer.
  • Set scale-dependent rendering for labels—When a map is zoomed out, more labels need to be drawn, which takes time. Examine your map document and determine if some labels do not need to be shown at smaller scales.
  • Use the most appropriate draw phase—The dynamic display has two draw phases—compiled and immediate (esriDDPCompiled and esriDDPImmediate respectively). Use the immediate draw phase when data is highly dynamic and changes need to take place immediately. Use the compiled draw phase when data is less dynamic. To optimize the layer drawing, draw in the appropriate drawing phase for the layer. For example, if the layer is set to draw in an immediate mode, the input drawing phase should be inspected and only draw if enum esriDynamicDrawPhase is set to esriDDPImmediate; otherwise, it will draw twice in each drawing cycle.
  • Verify dynamic symbols have already been created—When loading a new glyph in the DrawDynamicLayer method, set a flag to indicate if dynamic glyphs have been created. This ensures that dynamic glyphs are created only once. See the following code example:
[C#]
public override void DrawDynamicLayer(ESRI.ArcGIS.Display.esriDynamicDrawPhase
    DynamicDrawPhase, ESRI.ArcGIS.Display.IDisplay Display,
    ESRI.ArcGIS.Display.IDynamicDisplay DynamicDisplay)..... 
//Create the dynamic symbols for the layer.
if (!m_bDynamicGlyphsCreated)
{
    this.CreateDynamicSymbols(m_dynamicGlyphFactory);

    m_bDynamicGlyphsCreated = true;
}
[VB.NET]
Public override void DrawDynamicLayer(ESRI.ArcGIS.Display.esriDynamicDrawPhase DynamicDrawPhase, ESRI.ArcGIS.Display.IDisplay Display, ESRI.ArcGIS.Display.IDynamicDisplay DynamicDisplay)
.....
'Create the dynamic symbols for the layer.
If Not m_bDynamicGlyphsCreated Then
    Me.CreateDynamicSymbols(m_dynamicGlyphFactory)
    
    m_bDynamicGlyphsCreated = True
End If

Improving performance when drawing a large number of dynamic elements

To improve performance when drawing a large number of dynamic elements, use the following tips in addition to those in the previous section:
  • Use native C++ code—Use native code to avoid the overhead of the interop.
  • Simplify symbology when zooming out—Aggregate or simplify symbology when zooming out. Drawing a large amount of full blown features with labels and complex symbology clogs the display and degrades performance.
  • Choose glyph groups—Choose glyphs groups, whether internal or external, rather than creating glyphs from symbols. Dynamic display uses one texture for all symbology instead of creating many separated textures.
  • Reuse glyphs—Use glyphs if possible. Create one white glyph, then scale it and assign it a proper color at drawing time.
  • Use simple OpenGL-based glyphs for polygons and lines—When using polygons and lines, use simple OpenGL-based glyphs (glyphs group #0). OpenGL will not need to texture the lines and polygons, which results in better performance.
  • Create an indexed data structure—Use a spatially enabled indexed data structure instead of a flat data structure. This can be as simple as a list of lists. On each draw cycle, the dynamic layer iterates through the entire collection of geometries to draw them. A spatially indexed data structure allows the layer to access only the relevant elements of the data structure that are visible by the display and therefore, speeds up the data retrieval time.


See Also:

Dynamic display
Best practices for using dynamic display
Creating a base map for dynamic display
Persisting cache information for use in dynamic display
Controlling drawing characteristics of nondynamic layers using IDynamicCacheLayerManager
Rendering dynamic map content
How to create a dynamic glyph from a marker symbol




Development licensing Deployment licensing
Engine Developer Kit Engine Runtime
ArcView
ArcEditor
ArcInfo