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

Add Expander fast paths for expressions used in .NET SDK 9 #10409

Conversation

YuliiaKovalova
Copy link
Member

Fixes #10398

Context

Is fastpath isn't added for the method, it gets resoled by using reflection that is an expensive operation.
Since the covered methods are actively used by the main customers, they were added to MSBuild.

Changes Made

Add the method from the linked tickets.

Testing

Covered with unit tests.

@YuliiaKovalova YuliiaKovalova changed the title Add Fast paths to cover dotnet tools scenarious Add Fast paths to cover dotnet tools scenarios Jul 18, 2024
Copy link
Member

@baronfel baronfel left a comment

Choose a reason for hiding this comment

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

This LGTM, thank you for doing this so quickly! For future-us, is there a point at which we would want to switch from a series of if/else for matching to something more like a switch/dictionary lookup?

Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

For future-us, is there a point at which we would want to switch from a series of if/else for matching to something more like a switch/dictionary lookup?

Yeah I think there's a fair amount of room for tweaking here--personally I'd lean toward "make it generated from data" first, because that could let us use some of the sneakier "match to a set of strings" techniques.

src/Build/Microsoft.Build.csproj Outdated Show resolved Hide resolved
@YuliiaKovalova
Copy link
Member Author

This LGTM, thank you for doing this so quickly! For future-us, is there a point at which we would want to switch from a series of if/else for matching to something more like a switch/dictionary lookup?

Oh, definitely yes!
#9975

@JanKrivanek JanKrivanek mentioned this pull request Jul 18, 2024
18 tasks
@rainersigwald rainersigwald changed the title Add Fast paths to cover dotnet tools scenarios Add Expander fast paths for expressions used in .NET SDK 9 Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add missing Evaluator FastPath items for common SDK use cases
3 participants