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. |
||
|---|---|---|
| .. | ||
| CodeTree | ||
| Compiler | ||
| CSharpRazorCodeGeneratorTest.cs | ||
| LineMappingTest.cs | ||
| RazorCodeGeneratorTest.cs | ||
| TabTest.cs | ||
| TestSpan.cs | ||