Skip to content

Conversation

@pranavkm
Copy link
Contributor

@pranavkm pranavkm commented May 23, 2021

  • Use char.IsLetter / char.IsDigit etc to optimize for latin text
  • Remove some virtual calls that appear in profiles

@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label May 23, 2021
@pranavkm pranavkm marked this pull request as ready for review May 23, 2021 19:07
@pranavkm pranavkm requested a review from Pilchie as a code owner May 23, 2021 19:07
* Use char.IsLetter / char.IsDigit etc to optimize for latin text
* Avoid evaluating conditions inside Debug.Assert in release builds.
* Remove some expensive virtual calls
internal sealed class SeekableTextReader : TextReader, ITextDocument
{
private readonly RazorSourceDocument _sourceDocument;
private readonly string _filePath;
Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, messed up the PR. source.get_FilePath shows on the profiler (as do some of the other property accessors) as part of thew UpdateState function call which appears very frequently. The FilePath does not change for a source document, so it seemed like a easy enough fix.

@pranavkm pranavkm enabled auto-merge (squash) May 24, 2021 17:04
@pranavkm pranavkm merged commit 6b6280f into main May 24, 2021
@pranavkm pranavkm deleted the prkrishn/stuff branch May 24, 2021 17:47
@ghost ghost added this to the 6.0-preview6 milestone May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants