Skip to content

Improve start-up time by not using LINQ-Reflection combo for AccessibilityFeatures #9712

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

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

h3xds1nz
Copy link
Member

@h3xds1nz h3xds1nz commented Sep 4, 2024

Description

All WPF apps will spend now spend considerable time on startup verifying legacy accessibility switches setting. First it uses reflection to gather UseNetFx47CompatibleAccessibilityFeatures / UseNetFx471CompatibleAccessibilityFeatures / UseNetFx472CompatibleAccessibilityFeatures, then it orders and creates an array to go through its values, which is just a major overkill and this early it results in a big JITTing overhead besides other things.

As I personally don't think those properties are gonna grow in the direction where we would need such an over-engineered solution, I've decided to simplify it. This will improve the start-up time of all WPF apps.

Customer Impact

Improved start-up time, decreased start-up allocations.

Regression

No.

Testing

Local build.

Risk

Low, this removes an over-engineered solution for a simple logic evaluation.

Microsoft Reviewers: Open in CodeFlow

Copy link
Contributor

@himgoyalmicro himgoyalmicro left a comment

Choose a reason for hiding this comment

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

LGTM

@himgoyalmicro himgoyalmicro merged commit 5bd4ae1 into dotnet:main Jan 29, 2025
8 checks passed
@himgoyalmicro
Copy link
Contributor

Thank you, @h3xds1nz, for your consistent and valuable contributions. 😄

@h3xds1nz
Copy link
Member Author

@himgoyalmicro Thank you, happy this reflection bit is gone from startup 👍

@github-actions github-actions bot locked and limited conversation to collaborators Mar 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants