Long story short, our diagram is sometimes asked to add the same link twice. So, on each add link request, I want to add a check like this
// linksToAdd is an array of links we will add to the diagram linksToAdd = linksToAdd.filter(link => !diagram.findLinksByExample(link)?.count)
Since this will happen every time the diagram is given a new node, I wanted to know if I need to consider performance impact. I read GoJS Performance Considerations -- Northwoods Software but just wanted to double check.
From what I’ve heard,
findLinkForKey are very performant (constant time) since they utilize a lookup table. Is
findLinksByExample similarly performant or at least sufficiently performant in that it should not matter? Our use case is typically adding fewer than 25 links at a time and the diagram typically contains fewer than 1000 links, but it would be nice to know if there is a consideration at a larger scale as well.