Poor drawing performance can result when we ask too much of the computer. This usually manifests itself as a spinning beachball cursor appearing for extended periods.

The cause of such problems is almost always a style that is just too complex. Because everything is rendered as a vector, styles with many repeating elements render every element individually by computing the pixels that result from the vector description. It’s what gives us our beautiful smooth rendering at any scale, but it can come at the cost of requiring considerable computing power.

Ortelius 2.2 and later can automatically detect when a layer is talking a long time to draw, and trigger a warning to the user. It also hides the layer so that interacting with the application remains possible while you identify and resolve the issue. You will see this dialog:

In addition, the specific objects which are drawing slowly will be listed in the Layers panel in red, like so:

Here ‘Path1’ is the main culprit, and when we look at the style applied to that path, we find it has enormous complexity – we are asking the computer to render many thousands of tiny vector shapes every time the drawing is repainted.

The solution is to reduce the complexity of the style, so that the number or level of detail of the elements is reduced. This can require some creative consideration, so that you get a style that fits your requirements while remaining fast to render. If the style has multiple components, you can disable them and re-enable one at a time to identify the specific one that is rendering slowly. Often these will be pattern fills or path decorator components that are using complex vector paths as a pattern, rendered on a small scale, or with very close spacing. In general, you should probably avoid that type of thing, not just for performance reasons, but often they won’t result in clear styles that are good for the end users of your work.

In order to recover drawing performance while you edit a style, it’s useful to apply the default simple style to the objects that are rendering slowly temporarily, and use a small sized sample object to hold the slow style while you examine and change it. Keeping the layer hidden will also help, so that slow drawing doesn’t retrigger the warning again and again.