Does GoJS provide any built-in APIs for measuring performance (diagram load time, layout time, node/link rendering time)?

Hi Team,

We are working on a fairly complex diagramming application using GoJS, and we are looking to perform detailed performance analysis on various parts of the diagram lifecycle.

Before implementing our own instrumentation, I wanted to check if GoJS already provides any built-in performance metrics or diagnostic APIs.

Specifically, is there any way to measure:

  • Time taken to initialize and load a diagram into the canvas

  • Time taken for layouts to compute (e.g., TreeLayout / LayeredDigraphLayout / custom layouts)

  • Time taken to render nodes and links

  • Time taken to render shapes within node and link templates

  • Any existing hooks, events, debug flags, or internal timers that can be leveraged for this purpose

If there is no official API, is there a recommended approach to instrument these actions reliably without affecting the rendering pipeline?

Any guidance or best practices around benchmarking GoJS performance would be greatly appreciated.

Thanks!

No, there is no such API, but that’s a good suggestion.

It is easy of course to implement some of those timings yourself. For example, I often do something like:

let before = Date.now();
myDiagram.addDiagramListener("InitialLayoutCompleted", e => {
  const after = Date.now();
  console.log("load time: ", (after-before)/1000);
});

function load(modelstr) {
  before = Date.now();
  myDiagram.model = go.Model.fromJson(modelstr);
}

But there’s no reasonable way to get render timings for individual GraphObjects.

You can also use your browser’s debugging facilities, such as showing a frames-per-second counter.