Skip to content
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

Fix: Improve large project file loading performance #2665

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion meshroom/core/attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ def attributeFactory(description, value, isOutput, node, root=None, parent=None)
else:
attr.resetToDefaultValue()

attr.valueChanged.connect(lambda attr=attr: node._onAttributeChanged(attr))
# Only connect slot that reacts to value change once initial value has been set.
# NOTE: This should be handled by the Node class, but we're currently limited by our core
# signal implementation that does not support emitting parameters.
# And using a lambda here to send the attribute as a parameter causes
# performance issues when using the pyside backend.
attr.valueChanged.connect(attr._onValueChanged)

return attr

Expand Down Expand Up @@ -213,6 +218,10 @@ def _set_value(self, value):
self.valueChanged.emit()
self.validValueChanged.emit()

@Slot()
def _onValueChanged(self):
self.node._onAttributeChanged(self)

def _set_label(self, label):
if self._label == label:
return
Expand Down