Skip to content

Conversation

@jkoritzinsky
Copy link
Contributor

Move the DeferredSetter instance(s) to ValueStore. Now each AvaloniaObject has one DeferredSetter and there is not a global instance. Additionally, add a SingleOrQueue class to reduce memory usage in DeferredSetter machinery.

With these changes, memory usage in Control Catalog is reduced as shown below:

In #1703:

Objects Heap Size (KB)
966,731 56,749

In this PR:

Objects Heap Size (KB)
957,300 55,667

…e DeferredSetter for both styled and direct properties.
…nary. Remove SettingStatus entries for bindings from the dictionary for bindings that don't create a queue of pending values.
@jkoritzinsky jkoritzinsky requested a review from grokys July 6, 2018 20:00
return ((IDirectPropertyAccessor)GetRegistered(property)).GetValue(this);
}
else if (_values != null)
else if (Values != null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Values can never be null can it? I think this should be changed back to _values.

VerifyAccess();

return _values?.IsAnimating(property) ?? false;
return Values?.IsAnimating(property) ?? false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be _values too - we don't want to create the object here.

VerifyAccess();

return _values?.IsSet(property) ?? false;
return Values?.IsSet(property) ?? false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here.

{
VerifyAccess();
_values?.Revalidate(property);
Values?.Revalidate(property);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here.

@jkoritzinsky jkoritzinsky merged commit 6b9c269 into AvaloniaUI:master Jul 19, 2018
@jkoritzinsky jkoritzinsky deleted the ValueStoreDeferredSetter branch July 19, 2018 21:35
@grokys grokys added this to the 0.7.0 milestone Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants