Skip to content
3 changes: 0 additions & 3 deletions src/Compatibility/Core/src/Android/BackgroundManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ static void UpdateBackground(AView Control, VisualElement Element)

static void OnElementChanged(object sender, VisualElementChangedEventArgs e)
{
Performance.Start(out string reference);
if (e.OldElement != null)
{
e.OldElement.PropertyChanged -= OnElementPropertyChanged;
Expand All @@ -67,8 +66,6 @@ static void OnElementChanged(object sender, VisualElementChangedEventArgs e)
UpdateBackgroundColor(renderer?.View, renderer?.Element);
UpdateBackground(renderer?.View, renderer?.Element);
}

Performance.Stop(reference);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ void Dispose(bool disposing)

void OnElementChanged(object sender, VisualElementChangedEventArgs e)
{
Performance.Start(out string reference);
if (e.OldElement != null)
{
e.OldElement.PropertyChanged -= OnElementPropertyChanged;
Expand All @@ -94,8 +93,6 @@ void OnElementChanged(object sender, VisualElementChangedEventArgs e)
}

EffectUtilities.RegisterEffectControlProvider(this, e.OldElement, e.NewElement);

Performance.Stop(reference);
}

void UpdateIsEnabled()
Expand Down
18 changes: 0 additions & 18 deletions src/Compatibility/Core/src/Android/VisualElementTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ protected virtual void Dispose(bool disposing)

public void UpdateLayout()
{
Performance.Start(out string reference);

VisualElement view = _renderer.Element;
AView aview = _renderer.View;

Expand All @@ -94,31 +92,23 @@ public void UpdateLayout()

if (aview is MauiViewGroup formsViewGroup)
{
Performance.Start(reference, "MeasureAndLayout");
formsViewGroup.MeasureAndLayout(MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.Exactly), MeasureSpecFactory.MakeMeasureSpec(height, MeasureSpecMode.Exactly), x, y, x + width, y + height);
Performance.Stop(reference, "MeasureAndLayout");
}
else if ((aview is LayoutViewGroup || aview is ContentViewGroup || aview is CoordinatorLayout || aview is FragmentContainerView) && width == 0 && height == 0)
{
// Nothing to do here; just chill.
}
else
{
Performance.Start(reference, "Measure");
aview.Measure(MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.Exactly), MeasureSpecFactory.MakeMeasureSpec(height, MeasureSpecMode.Exactly));
Performance.Stop(reference, "Measure");

Performance.Start(reference, "Layout");
aview.Layout(x, y, x + width, y + height);
Performance.Stop(reference, "Layout");
}

// We have to make sure to update the ClipBounds to match the new size of the ViewGroup
UpdateClipToBounds();
UpdateClip();

Performance.Stop(reference);

//On Width or Height changes, the anchors needs to be updated
UpdateAnchorX();
UpdateAnchorY();
Expand Down Expand Up @@ -326,8 +316,6 @@ void UpdateIsVisible()

void UpdateNativeView(object sender, EventArgs e)
{
Performance.Start(out string reference);

VisualElement view = _renderer.Element;
AView aview = _renderer.View;

Expand Down Expand Up @@ -362,21 +350,15 @@ void UpdateNativeView(object sender, EventArgs e)
_context.ToPixels(view.TranslationX),
_context.ToPixels(view.TranslationY));
}

Performance.Stop(reference);
}

[PortHandler]
void UpdateOpacity()
{
Performance.Start(out string reference);

VisualElement view = _renderer.Element;
AView aview = _renderer.View;

aview.Alpha = (float)view.Opacity;

Performance.Stop(reference);
}

[PortHandler]
Expand Down
3 changes: 0 additions & 3 deletions src/Compatibility/Core/src/iOS/VisualElementTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,6 @@ void SetElement(VisualElement oldElement, VisualElement newElement)
[PortHandler("Partially ported")]
void UpdateNativeControl()
{
Performance.Start(out string reference);

if (_disposed)
return;

Expand All @@ -399,7 +397,6 @@ void UpdateNativeControl()
UpdateClip();

NativeControlUpdated?.Invoke(this, EventArgs.Empty);
Performance.Stop(reference);
}

void UpdateClip()
Expand Down
96 changes: 0 additions & 96 deletions src/Controls/src/Build.Tasks/PerformanceProvider.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ public AView GetCell(Cell item, AView convertView, ViewGroup parent, Context con
if (parent == null && ParentView?.Handler?.PlatformView is ViewGroup platformParent)
parent = platformParent;

Performance.Start(out string reference);

if (Cell is ICellController cellController)
cellController.ForceUpdateSizeRequested -= OnForceUpdateSizeRequested;

Expand Down Expand Up @@ -99,17 +97,13 @@ public AView GetCell(Cell item, AView convertView, ViewGroup parent, Context con
Cell.PropertyChanged += PropertyChangedHandler;
((ICellController)Cell).SendAppearing();

Performance.Stop(reference);

return view;
}

#pragma warning disable CS0618 // Type or member is obsolete
protected virtual AView GetCellCore(Cell item, AView convertView, ViewGroup parent, Context context)
#pragma warning restore CS0618 // Type or member is obsolete
{
Performance.Start(out string reference, "GetCellCore");

LayoutInflater inflater = LayoutInflater.FromContext(context);
const int type = global::Android.Resource.Layout.SimpleListItem1;
AView view = inflater.Inflate(type, null);
Expand All @@ -119,8 +113,6 @@ protected virtual AView GetCellCore(Cell item, AView convertView, ViewGroup pare
textView.SetBackgroundColor(global::Android.Graphics.Color.Transparent);
view.SetBackgroundColor(global::Android.Graphics.Color.Black);

Performance.Stop(reference, "GetCellCore");

return view;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,6 @@ public override AView GetView(int position, AView convertView, ViewGroup parent)
Cell cell = null;
#pragma warning restore CS0618 // Type or member is obsolete

Performance.Start(out string reference);

ListViewCachingStrategy cachingStrategy = Controller.CachingStrategy;
var nextCellIsHeader = false;
if (cachingStrategy == ListViewCachingStrategy.RetainElement || convertView == null)
Expand All @@ -267,8 +265,6 @@ public override AView GetView(int position, AView convertView, ViewGroup parent)

if (cell == null)
{
Performance.Stop(reference);

return new AView(_context);
}
}
Expand Down Expand Up @@ -353,14 +349,11 @@ public override AView GetView(int position, AView convertView, ViewGroup parent)
else
UnsetSelectedBackground(layout);

Performance.Stop(reference);
return layout;
}

AView view = CellFactory.GetCell(cell, convertView, parent, _context, _listView);

Performance.Start(reference, "AddView");

if (cellIsBeingReused)
{
if (convertView != view)
Expand All @@ -377,8 +370,6 @@ public override AView GetView(int position, AView convertView, ViewGroup parent)
}
}

Performance.Stop(reference, "AddView");

#pragma warning disable CS0618 // Type or member is obsolete
#pragma warning disable CS0618 // Type or member is obsolete
bool isHeader = cell.GetIsGroupHeader<ItemsView<Cell>, Cell>();
Expand Down Expand Up @@ -407,8 +398,6 @@ public override AView GetView(int position, AView convertView, ViewGroup parent)

layout.ApplyTouchListenersToSpecialCells(cell);

Performance.Stop(reference);

return layout;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public class ViewCellRenderer : CellRenderer
protected override AView GetCellCore(Cell item, AView convertView, ViewGroup parent, Context context)
#pragma warning restore CS0618 // Type or member is obsolete
{
Performance.Start(out string reference, "GetCellCore");
#pragma warning disable CS0618 // Type or member is obsolete
var cell = (ViewCell)item;
#pragma warning restore CS0618 // Type or member is obsolete
Expand All @@ -27,7 +26,6 @@ protected override AView GetCellCore(Cell item, AView convertView, ViewGroup par
if (container is not null)
{
container.Update(cell);
Performance.Stop(reference, "GetCellCore");
return container;
}

Expand Down Expand Up @@ -71,8 +69,6 @@ protected override AView GetCellCore(Cell item, AView convertView, ViewGroup par

var newContainer = new ViewCellContainer(context, (IPlatformViewHandler)cell.View.Handler, cell, ParentView, unevenRows, rowHeight);

Performance.Stop(reference, "GetCellCore");

return newContainer;
}

Expand Down Expand Up @@ -213,17 +209,13 @@ public void Update(ViewCell cell)
// This cell could have a handler that was used for the measure pass for the ListView height calculations
//cell.View.Handler.DisconnectHandler();

Performance.Start(out string reference);
var viewHandlerType = _viewHandler.MauiContext.Handlers.GetHandlerType(cell.View.GetType());
var reflectableType = _viewHandler as System.Reflection.IReflectableType;
var rendererType = reflectableType != null ? reflectableType.GetTypeInfo().AsType() : (_viewHandler != null ? _viewHandler.GetType() : typeof(System.Object));
if (_viewHandler != null && rendererType == viewHandlerType)
{
Performance.Start(reference, "Reuse");
_viewCell = cell;

Performance.Start(reference, "Reuse.SetElement");

if (_viewHandler != cell.View.Handler)
{
if (cell.View.Handler?.PlatformView is AView oldCellView &&
Expand All @@ -241,12 +233,8 @@ public void Update(ViewCell cell)
AddView(_viewHandler.PlatformView);
}

Performance.Stop(reference, "Reuse.SetElement");

Invalidate();

Performance.Stop(reference, "Reuse");
Performance.Stop(reference);
return;
}

Expand All @@ -265,8 +253,6 @@ public void Update(ViewCell cell)

UpdateIsEnabled();
UpdateWatchForLongPress();

Performance.Stop(reference);
}

public void UpdateIsEnabled()
Expand Down Expand Up @@ -310,8 +296,6 @@ protected override void OnLayout(bool changed, int l, int t, int r, int b)

protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
Performance.Start(out string reference);

int width = MeasureSpec.GetSize(widthMeasureSpec);
int height;

Expand All @@ -334,8 +318,6 @@ protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
}

SetMeasuredDimension(width, height);

Performance.Stop(reference);
}

bool WatchForSwipeViewTap()
Expand Down
Loading
Loading