How to advance the layout calculation?

hi,
How to advance the layout calculation?
How the results of calculations such as layout node position size are combined with the graph display ?
Use the Sankey layout data amount to calculate the node size and the node position information takes too long. The 1000 node 1000 edges takes 2 minutes and most of the time is used in the layout calculation. I want to calculate this part,Do it in advance or put it in other threads. I think this will reduce the time to render the plot.

Thanks!

Add a TwoWay Binding of Node.location to the node template.

    new go.Binding("location", "location", go.Point.parse).makeTwoWay(go.Point.stringify),

Add a TwoWay Binding of Link.points to the link template.

    new go.Binding("points").makeTwoWay(),

Perform the layout. Save the model, which will now include the computed node locations and link routes.

Then you can load the model whenever you want if you first either never set the Diagram.layout or if you set Layout.isInitial to false on the SankeyLayout. You must do this last step: either not setting the diagram’s layout or making the layout not perform an initial layout when a model is loaded.