Skip to content

Conversation

@grokys
Copy link
Member

@grokys grokys commented Apr 20, 2022

What does the pull request do?

Removes IAvaloniaPropertyVisitor which was based around using generic virtual methods, which we're trying to remove. It was only used internally in creating ISetterInstances so adds a virtual method to AvaloniaProperty to do this explicitly without generic virtual methods.

This PR includes the changes from #8021 so until that is merged you can see the changes specific to this PR in the commit Remove IAvaloniaPropertyVisitor.

grokys added 5 commits April 20, 2022 17:09
Not sure why these method were virtual anyway: any customization should be done by overriding the non-generic `CreateItemContainerGenerator` method.
It was only used internally in creating `ISetterInstance`s so add a virtual method to `AvaloniaProperty` to do this explicitly without generic virtual methods.
@grokys grokys requested review from MarchingCube and kekekeks April 20, 2022 20:50
@grokys grokys changed the title Remove IAvaloniaPropertyVisitor due to generic virtual method. Remove IAvaloniaPropertyVisitor due to generic virtual methods. Apr 20, 2022
@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 0.10.999-cibuild0020067-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 0.10.999-cibuild0020071-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

@grokys
Copy link
Member Author

grokys commented Apr 21, 2022

Benchmarks as compared with #7980 and filtered for noise:

| Faster                                                                           | base/diff | Base Median (ns) | Diff Median (ns) | Modality  |
| -------------------------------------------------------------------------------- | ---------:| ----------------:| ----------------:| ---------- |
| Avalonia.Benchmarks.Layout.ControlsBenchmark.CreateTextBox                       |      2.10 |       2782200.00 |       1325559.18 | multimodal|

Only one benchmark has changed, but it's 2x faster.

@grokys grokys merged commit 4f8dfee into master Apr 21, 2022
@grokys grokys deleted the refactor/remove-propertyvisitor branch April 21, 2022 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants