# Editor Benchmark Assets

These files are official editor performance benchmark inputs.

## 5mb.md

Source: user-provided Milestone 2.6 benchmark document.

Measured on May 30, 2026:

| Property | Value |
| --- | ---: |
| File size | 5,526,168 bytes |
| Characters | 5,474,683 |
| UTF-16 units | 5,526,164 |
| Physical lines | 51,482 |
| CR characters | 51,481 |
| LF characters | 51,481 |
| Max line UTF-16 length | 658 |
| Average line UTF-16 length | 105.342 |

Markdown structure:

| Construct | Count |
| --- | ---: |
| ATX headings | 2 |
| Unordered list items | 2 |
| Ordered list items | 0 |
| Blockquotes | 0 |
| Fenced code fences | 0 |
| Lines with inline code | 0 |
| Lines with bold markers | 0 |
| Lines with italic markers | 0 |
| Inline links | 0 |
| Reference-style link markers | 51,156 |
| Images | 0 |

Important characteristic:

The file uses CRLF line endings. Swift treats `"\r\n"` as a single newline grapheme cluster, so code that searches a `String` for `Character("\n")` does not split this file into logical editor lines.

Milestone 2.7 corrected Sapling's editor line index to scan UTF-16 line ending code units directly. The benchmark now segments into 51,482 editor lines.

Reproduce:

```sh
swift run -c release SaplingEditorBenchmark Docs/Benchmarks/5mb.md
```
