Performance Pros and Cons When Displaying Graphs

Questions & Answers

Summary

How to speed up the redraw of graphs in the view.
For a better user experience, please go to the integrated documentation viewer to read this article.

Description

When displaying large graphs in a Graph2DView, it is important to maintain the user experience and avoid (or at least minimize) any degradations in application response time. Especially the redraw of a huge number of graphical elements (nodes, edges, labels, etc.) can become a bottleneck.

To optimize the redraw performance for large graphs there can be taken several steps.

Simplification

Simplifying the visual representation of a graph means both reducing the number of graphical elements as well as using standard means to draw elements.
Actions with a positive effect on redraw performance include the following:

  • Minimizing the number of node labels and edge labels.
  • Minimizing the number of graphical decorations (i.e., arrowheads) at the ends of edges.
  • Using simple shapes (like rectangle) to draw nodes, for instance.
  • Using plain colors to fill nodes, i.e., in particular avoiding gradients.
  • Using straight lines to draw edges, i.e., avoiding dashed or dotted lines.

Design Decisions

Making design decisions for an application's graph functionality means choosing the paradigm (and consequently, also the classes) for rendering nodes and edges. Also, the interaction behind the scenes of an application is affected. Positive effects on redraw performance can be observed when:

Categories this article belongs to:
yFiles for Java > yFiles Viewer > Displaying and Editing Graphs
yFiles for Java > Deployment
Applies to:
yFiles for Java 2: 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 2.10, 2.11, 2.12, 2.13, 2.14, 2.15, 2.16, 2.17, 2.18
Keywords:
performance - Graph2DView - speed - large - graphs - view - redraw - slow