Commit 8efa138
authored
perf: use EnumerateLines for line splitting in HtmlReportGenerator (#6089)
* perf: use EnumerateLines for line splitting in HtmlReportGenerator
Replace `message.Replace("\r\n", "\n").Split('\n')` with span-based
`MemoryExtensions.EnumerateLines()` on net8+, eliminating the Replace
string and Split array allocations per rendered test result. The
netstandard2.0 path retains the existing Replace/Split fallback.
Behavior is identical: both code paths match the same line prefixes.
Closes #6034
* perf: early-exit TryExtractExpectedActual once both values found
Address review on PR #6089: stop scanning the assertion message as soon as
both the Expected and Actual lines have been captured, instead of iterating
every remaining line (stack traces, diff blocks). Applied to both the #if NET
EnumerateLines path and the netstandard2.0 Split fallback.1 parent 93ad4ff commit 8efa138
1 file changed
Lines changed: 38 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
672 | 672 | | |
673 | 673 | | |
674 | 674 | | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
675 | 696 | | |
676 | 697 | | |
677 | 698 | | |
| |||
685 | 706 | | |
686 | 707 | | |
687 | 708 | | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
688 | 714 | | |
| 715 | + | |
689 | 716 | | |
690 | 717 | | |
691 | 718 | | |
| |||
767 | 794 | | |
768 | 795 | | |
769 | 796 | | |
770 | | - | |
771 | 797 | | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
772 | 808 | | |
773 | 809 | | |
774 | 810 | | |
775 | 811 | | |
776 | 812 | | |
777 | 813 | | |
| 814 | + | |
778 | 815 | | |
779 | 816 | | |
780 | 817 | | |
| |||
0 commit comments