Skip to content

Conversation

@ToddGrun
Copy link
Contributor

@ToddGrun ToddGrun commented Jun 7, 2025

This is a port of dotnet/roslyn#73650 to Razor

The general idea behind this PR is that calls to getting items in a syntax list are typically done sequentially, and thus walking the full children of a node is often not necessary.

See the Roslyn PR for detailed performance analysis that was done upon the roslyn investigation.

In the roslyn speedometer test profile that I'm looking at, 0.8% of CPU is spent in ChildSyntaxList.ItemInternal (1.8 seconds of CPU), so this optimization is worth bringing over from Roslyn.

image

This is a port of dotnet/roslyn#73650 to Razor

The general idea behind this PR is that calls to getting items in a syntax list are typically done sequentially, and thus walking the full children of a node is often not necessary.

See the Roslyn PR for detailed performance analysis that was done upon the roslyn investigation. Noted that
@ToddGrun ToddGrun requested a review from a team as a code owner June 7, 2025 00:34
Copy link
Member

@DustinCampbell DustinCampbell left a comment

Choose a reason for hiding this comment

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

Thanks for bringing this over!

@ToddGrun
Copy link
Contributor Author

ToddGrun commented Jun 9, 2025

@dotnet/razor-compiler for 2nd compiler review

@ToddGrun ToddGrun merged commit 3484948 into main Jun 9, 2025
11 checks passed
@ToddGrun ToddGrun deleted the dev/toddgrun/ChildSyntaxList.ItemInternal branch June 9, 2025 22:02
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Jun 9, 2025
@RikkiGibson RikkiGibson modified the milestones: Next, 18.0 P1 Aug 20, 2025
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.

5 participants