When nodes are being moved, we sort all of the nodes on each movement. This allows for lines to properly connect and this is desired behavior.
However, at any given movement we only need to swap the position of 2 nodes. This is in place and should be pretty fast since we know the specific node that needs to move and we can return early if it's still in place.
It isn't clear how great of a performance problem this turns out to be, but it happens often enough that it's a possible bottleneck and an easy optimization.
When nodes are being moved, we sort all of the nodes on each movement. This allows for lines to properly connect and this is desired behavior.
However, at any given movement we only need to swap the position of 2 nodes. This is in place and should be pretty fast since we know the specific node that needs to move and we can return early if it's still in place.
It isn't clear how great of a performance problem this turns out to be, but it happens often enough that it's a possible bottleneck and an easy optimization.