How to override Group.findExternalLinksConnected method

when open an group with hundreds of nodes and links, it’s very slow, and i find the most time-consuming method is Group.findExternalLinksConnected, so i want to implement the method by myself.

That method is responsible for finding all of the links that connect with a group or any of its nested nodes and that also connect with a node outside of that group.

What percentage of the time is that method taking? What operation is the user performing at that time?

How deeply nested are the groups? How many nodes and links does each group have?

We’ll review the implementation of that method later today.

I just created a simple test app consisting of a very deeply nested tree of Groups, with each Group holding a Group and a Node and a Link between them, along with a single Node at top-level and a Link between each Group and that single Node. Here’s a screenshot:

Running a performance monitor while dragging around either the single Node (shown selected in the screenshot) or one of the Nodes in the middle, halfway down the containment hierarchy, show that only 0.08% of the time is spent in Group.findExternalLinksConnected.

The performance is pretty good, from 50-60 frames per second. That includes not only moving one node around, but also either re-routing half of the Links or remeasuring and rearranging half the Groups. And also redrawing everything.

It is certainly possible that we could reimplement Group.findExternalLinksConnected to be more efficient. However we would need to be convinced that that really would help performance.

Hi,There are only two layers of nested groups. IsSubGraphExpanded is initially set to false. The top group contains just five sub-groups, and it’s expanded quickly. And each sub-group contains ninety nodes and five hundred links, but they are expanded very slowly. The CPU profiles show that 16.30% of the time is spent in Group.findExternalLInksConnected. The method seems to be called by findSubGraphParts.

Yes, we see what you mean. This will take some time for us to investigate.

I believe this will be greatly improved in the next release, 1.7.7, which I hope will come out in the first half of next week.

Well, I am looking forward to the new release!

Could you try the new release at GoJS - Build Interactive Diagrams for the Web, before it becomes “latest”? We’d like to make sure it’s working better for you.

I have tried the new version, and performance improvement is obvious.
With the same data test, the new version only need less than 2 seconds, but the old version takes more than 10 seconds.
When the new version is officially released?

I expect it will be later today, our time.

Please try different and unusual situations to make sure it really is working correctly for you in all kinds of circumstances.