Commit 6f2e66a
perf: avoid Seq allocations in hot markdown-parsing paths
- removeSpaces: replace Seq.takeWhile+Seq.length per line with
String.TrimStart().Length — avoids boxing each char and allocating
two enumerators per non-empty line.
- StartsWithNTimesTrimIgnoreStartWhitespace: replace Seq.windowed +
Seq.map String + Seq.takeWhile + Seq.length with a direct index loop
— avoids O(n) sliding-window allocations just to count consecutive
fence characters (e.g. backticks or tildes) at the start of a line.
Called for every line during markdown block parsing.
- XmlDocReader.readXmlElementAsSingleSummary: same Seq.takeWhile fix
when checking indentation columns of XML doc comment lines.
All 520 tests pass (317 Markdown, 143 Literate, 30 CodeFormat, 30 ApiDocs).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 01844d6 commit 6f2e66a
3 files changed
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
233 | 239 | | |
234 | 240 | | |
235 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
0 commit comments