Skip to content

Conversation

@grokys
Copy link
Member

@grokys grokys commented Jun 25, 2018

Following on from #1690, another PR to reduce memory allocations. This makes ExpressionNodes no longer ISubject<>s and instead transitions them to using an explicit Subscribe/Unsubscribe model.

ExpressionNodes were always single-subscriber and making them use IObservable<> meant that we had to have extra allocations in order to return IDisposables.

This saves a bunch more memory.

Memory Usage

Memory usage was measured via the VS2017 diagnostic tools by running ControlCatalog in Release mode, opening all pages and then taking a memory snapshot:

On master (after #1690):

Objects Heap Size (KB)
1,478,158 79,936

This PR:

Objects Heap Size (KB)
1,381,936 76,310

`ExpressionNode`s were always single-subscriber and making them use `IObservable<>` meant that we had to have extra allocations in order to return `IDisposable`s. Instead of using `IObservable` use a simpler `Subscribe`/`Unsubscribe` pattern. This saves a bunch more memory.
@grokys grokys requested review from a team and jkoritzinsky June 25, 2018 07:52
This shouldn't happen normally as `InpcPropertyAcessorPlugin` matches everything.
@wieslawsoltes
Copy link
Collaborator

LGTM
Tested with Core2D, nothing breaks.

@wieslawsoltes
Copy link
Collaborator

Before:
build5521
After:
build5528

@grokys grokys merged commit de9644f into master Jun 29, 2018
@grokys grokys deleted the nonrx-expressionnode branch June 29, 2018 07:49
@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.

3 participants