Drawing number of objects on sockets
Created by: Durman
Problem statement
The function is calling each time when UI is redrawing. UI is redrawing each time when mouse is passed over any interactive element on a screen. The function is calling other
method of socket which is calling links
method which is actually quite expensive. Calling links
method takes O(n) time where n
is number of links in a tree.
https://github.com/nortikin/sverchok/blob/61deb2ff87885fae0489c8016e03c2e5fa604dfd/core/socket_data.py#L47-L67
So with growing size of a tree number of calculations is growing exponentially and recalculating quite often. It definitely can be reimplemented. I think that number of objects can be recalculated during tree update event and memorize in sockets somewhere.