-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drawing number of objects on sockets #2772
Comments
perhaps, the socket class i've thought about this too in the past when visiting these areas of code, and i'm supportive of reducing redundant cpu cycles, but here i'm apprehensive to implement |
but whatever :) we can try it |
Having a compiled links data structure would be good and would also make the update system easier. |
Made a very simple cache implementation for these kind of issues. Untested as a minimal implemenation. |
By the way I was thinking about Or probably it would be possible to keep references to nodes but they will resetting upon each update event and undo event. In this case it becomes easier to crush Blender. |
default off I will not miss personally. |
Line 229 in 09e9788
And performance without calling the function. info_text = t + '. ' |
every time calculate length is much of lost? |
According the fact that not just number of objects of other output sockets should be shown but also the number of objects after they will be converted from that sockets the only way to improve performance is to calculate and to memorize this value during update event. Only case when number of objects does not coincide is conversion from vector to matrix sockets now. And the reason of it is that matrixes are treated differently and inconsistently with other data types. |
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 callinglinks
method which is actually quite expensive. Callinglinks
method takes O(n) time wheren
is number of links in a tree.sverchok/core/socket_data.py
Lines 47 to 67 in 61deb2f
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.
The text was updated successfully, but these errors were encountered: