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

Optimize some hot paths to speed up formatting. #277

Closed
belav opened this issue Jun 7, 2021 · 0 comments
Closed

Optimize some hot paths to speed up formatting. #277

belav opened this issue Jun 7, 2021 · 0 comments
Milestone

Comments

@belav
Copy link
Owner

belav commented Jun 7, 2021

A single method in SyntaxNodeComparer was resulting in 10% of the execution time by using a Where on a SyntaxTriviaList before passing it to another method.
Optimizing that to not use Where should make it much more efficient.

The IndentBuilder is another hot path that is doing a bunch of extra work related to dedent, even though CSharpier doesn't support dedenting.

Doc.Concat is unnecessarly creating List when it could use Doc[] or List as IList

A number of Doc's can be a single instance instead of being created over and over.

@belav belav added this to the 0.9.6 milestone Jun 7, 2021
@belav belav closed this as completed Jun 7, 2021
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

No branches or pull requests

1 participant