Skip to content

perf: Fix boxing in the BorderLayerRenderer#20037

Closed
dluhring wants to merge 1 commit intounoplatform:masterfrom
dluhring:master
Closed

perf: Fix boxing in the BorderLayerRenderer#20037
dluhring wants to merge 1 commit intounoplatform:masterfrom
dluhring:master

Conversation

@dluhring
Copy link
Copy Markdown

GitHub Issue (If applicable): closes #16107

#16107

PR Type

Performance Fix
What kind of change does this PR introduce?
Bugfix
Refactoring (no functional changes, no api changes)

What is the current behavior?

Boxing was observed in the border equals function.

What is the new behavior?

We unfortunately have not been able to figure out quality assurance methods (neither developer mode in Chrome or PerfView). however, we believe this should reduce the amount of boxing that is occurring in the .Equals comparison function found in BorderLayerRenderer UpdatePlatform method.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 23, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform labels Apr 23, 2025
@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-20037/index.html

@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-20037/index.html

@unodevops
Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 162466 has failed on Uno.UI - CI.

var previousLayoutState = _currentState;

if (newState.Equals(previousLayoutState) && !forceUpdate)
if (newState.Equals((BorderLayerState)previousLayoutState) && !forceUpdate)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this changes anything. The type of previousLayoutState is already BorderLayerState so the cast is redundant here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is indeed the case, looking at it again. newState is a BorderLayerState which is already explicitly type. This must have changed since the original issue was opened.

Thanks for trying this out @dluhring, I'll be closing this PR as it's not improving the situation.

Copy link
Copy Markdown
Member

@Youssef1313 Youssef1313 May 16, 2025

Choose a reason for hiding this comment

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

This must have changed since the original issue was opened.

The original issue didn't state that the issue is at this line. The boxing happens inside Equals (which is synthesized by the compiler).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BorderLayerState.Equals will box Sizes

5 participants