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

[performance] all PropertyMapper's set the same values over and over #17303

Open
jonathanpeppers opened this issue Sep 11, 2023 · 2 comments
Open
Labels
area-architecture Issues with code structure, SDK structure, implementation details delighter-sc legacy-area-perf Startup / Runtime performance proposal/open t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.)
Milestone

Comments

@jonathanpeppers
Copy link
Member

Description

A good example of this is:

internal static partial class ActivityExtensions
{
internal static Rect GetWindowFrame(this Android.App.Activity activity)
{
var bounds = PlatformInterop.GetCurrentWindowMetrics(activity);
return activity.FromPixels(bounds);
}
internal static void UpdateX(this Android.App.Activity activity, IWindow window) =>
activity.UpdateUnsupportedCoordinate(window);
internal static void UpdateY(this Android.App.Activity activity, IWindow window) =>
activity.UpdateUnsupportedCoordinate(window);
internal static void UpdateWidth(this Android.App.Activity activity, IWindow window) =>
activity.UpdateUnsupportedCoordinate(window);
internal static void UpdateHeight(this Android.App.Activity activity, IWindow window) =>
activity.UpdateUnsupportedCoordinate(window);
internal static void UpdateUnsupportedCoordinate(this Android.App.Activity activity, IWindow window) =>
window.FrameChanged(activity.GetWindowFrame());

But patterns like this are in many places currently in .NET MAUI.

The only place we've attempted to do something better is:

class AndroidBatchPropertyMapper<TVirtualView, TViewHandler> : PropertyMapper<TVirtualView, TViewHandler>

But ideally, a pattern could be adopted/invented for all platforms.

Public API Changes

Depending on what the new, invented pattern is. There may be public API changes, not sure.

Intended Use-Case

Improved performance for:

  • Startup
  • Creating new controls/views
  • Scrolling data-bound CollectionView
  • etc. etc.
@jonathanpeppers jonathanpeppers added proposal/open legacy-area-perf Startup / Runtime performance labels Sep 11, 2023
@jonathanpeppers jonathanpeppers added this to the .NET 9 Planning milestone Sep 11, 2023
@jonathanpeppers jonathanpeppers changed the title [performance] all PropertyMapper's call the set the same values over an over [performance] all PropertyMapper's set the same values over an over Sep 11, 2023
@jonathanpeppers jonathanpeppers changed the title [performance] all PropertyMapper's set the same values over an over [performance] all PropertyMapper's set the same values over and over Sep 11, 2023
@bcaceiro
Copy link

This should be on the top of the list for analysis, since may affects all platforms, performance etc.

@MartyIX
Copy link
Collaborator

MartyIX commented Apr 14, 2024

@bcaceiro If you feel this issue is important, then please upvote it.

@Eilon Eilon added the t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) label May 10, 2024
@PureWeen PureWeen added the area-architecture Issues with code structure, SDK structure, implementation details label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-architecture Issues with code structure, SDK structure, implementation details delighter-sc legacy-area-perf Startup / Runtime performance proposal/open t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.)
Projects
None yet
Development

No branches or pull requests

6 participants