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

Cache internal objects used by the formatting engine. #73487

Merged
merged 5 commits into from
May 15, 2024

Conversation

CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented May 15, 2024

Drops allocations by 2.2%. Review a commit at a time.

image

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 15, 2024
@CyrusNajmabadi CyrusNajmabadi changed the title WIP. Cache internal objects used by the formatting engine. May 15, 2024
}

protected SyntaxFormattingOptions Options { get; }
protected string Language => _language;
protected LineFormattingOptions Options { get; }
Copy link
Member Author

Choose a reason for hiding this comment

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

all consumers only need the limited amount of info exposed by LineFormattingOPtions, not the full info in SyntaxFormattingOptions.

}

protected SyntaxFormattingOptions Options { get; }
protected string Language => _language;
Copy link
Member Author

Choose a reason for hiding this comment

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

Never used. Removed.


protected AbstractTriviaDataFactory(TreeData treeInfo, SyntaxFormattingOptions options)
protected AbstractTriviaDataFactory(TreeData treeInfo, LineFormattingOptions options)
Copy link
Contributor

Choose a reason for hiding this comment

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

TreeData treeInfo

Does this need to be sent in now?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll check. But it is exposed as a property on this type.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, yes, that is used by the derived factories.

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review May 15, 2024 14:36
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 15, 2024 14:36
@CyrusNajmabadi CyrusNajmabadi merged commit 07d80d7 into dotnet:main May 15, 2024
25 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the formattingPerf branch May 15, 2024 14:37
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone May 15, 2024
@Cosifne Cosifne modified the milestones: Next, 17.11 P2 May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants