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

Modify (Large/Source)Text.ParseLineStart to specify an initial capacity for line count #73701

Merged

Conversation

ToddGrun
Copy link
Contributor

Noticed this in a Find All References profile, the LargeText.ParseLineStarts was showing as 6.2% of allocations and SourceText.ParseLineStarts was 0.4%.

With this change, these reduced to 4.7% and 0.2% respectively.

*** before ***
image
and
image

*** after ***
image
and
image

Per Tomas, the enc analyzer can be trivially changed for this support.
Also, smal change where I missed one location in method extractor analyzer that needed a change
…ty for line count

Noticed this in a Find All References profile, the LargeText.ParseLineStarts was showing as 6.2% of allocations and SourceText.ParseLineStarts was 0.4%.

With this change, these reduced to 4.7% and 0.2% respectively.
@ToddGrun ToddGrun requested review from a team as code owners May 24, 2024 21:09
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels May 24, 2024
@ToddGrun
Copy link
Contributor Author

@dotnet/roslyn-compiler ptal

@ToddGrun
Copy link
Contributor Author

@dotnet/roslyn-compiler -- ptal

1 similar comment
@ToddGrun
Copy link
Contributor Author

@dotnet/roslyn-compiler -- ptal

@@ -238,7 +238,9 @@ private SegmentedList<int> ParseLineStarts()
var position = 0;
var index = 0;
var lastCr = -1;
var list = new SegmentedList<int>();
// Initial line capacity estimated at 64 chars / line. This values was obtained by
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Initial line capacity estimated at 64 chars / line. This values was obtained by
// Initial line capacity estimated at 64 chars / line. This value was obtained by

@@ -1049,7 +1049,9 @@ private SegmentedList<int> ParseLineStarts()
return [0];
}

var lineStarts = new SegmentedList<int>()
// Initial line capacity estimated at 64 chars / line. This values was obtained by
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Initial line capacity estimated at 64 chars / line. This values was obtained by
// Initial line capacity estimated at 64 chars / line. This value was obtained by

@ToddGrun
Copy link
Contributor Author

@dotnet/roslyn-compiler -- ptal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers 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.

4 participants