GetSourceLocation is frequently called to determine the location mappings between the original document and the generated code. The old implementation did a number of ToString and replace operations to simplify the math on tracking the position - which put it front and center in our performance measurements - about 25% of all execution time in a sampling profile of our perf test. The new code tracks position as code is written, and avoids allocations. After these changes GetSourceLocation doesn't show up in the profile. |
||
|---|---|---|
| .. | ||
| Editor | ||
| Framework | ||
| Generator | ||
| Parser | ||
| TestFiles | ||
| Text | ||
| Tokenizer | ||
| Utils | ||
| CSharpRazorCodeLanguageTest.cs | ||
| Microsoft.AspNet.Razor.Test.kproj | ||
| Project.json | ||
| RazorCodeLanguageTest.cs | ||
| RazorDirectiveAttributeTest.cs | ||
| RazorEngineHostTest.cs | ||
| RazorTemplateEngineTest.cs | ||
| StringTextBuffer.cs | ||