3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-15 13:00:26 +01:00

Read deep list items' blank lines and a directive's unclosed backtick runs in time linear in the markdown

This commit is contained in:
2026-10-18 11:15:30 +02:00
committed by Lillem4n
parent a9cdd70365
commit d82b7abb3f
11 changed files with 119 additions and 71 deletions
+4 -2
View File
@@ -826,8 +826,10 @@ rather than a figure.
A cost fix that changes no behaviour lands on the suite staying green with no fixture output
changed, and a before-and-after figure in its PR; the gate times nothing. Measured and kept:
`adfDocumentFault`'s shape and depth walks stay two — the parting gives depth its own code — at
52 ms for a 9 MB document the emit takes 314 ms over; and `continuesContainer`'s re-scan per item
level stays, linear in the lines and bounded in depth by the 500-level guard.
52 ms for a 9 MB document the emit takes 314 ms over. The 500-level guard runs after the block walk,
so it bounds nothing in it: `matchBlankLine` continues a blank line through the open list items in
one step, and an item reads a line's indentation only up to its own width, which took 20000 nested
items and as many blank lines from 10.7 s to 39 ms.
## Only the hard break holds a raw newline
+13
View File
@@ -419,3 +419,16 @@ Read most (opens and searches):
- `ci.sh` 1
- `docker-runner.sh` 1
- `spec/flavour.md` 1
## Reading cost, chunk bf9bc185d8b8, finished 2026-10-18T09:09:42Z
84940 new input tokens before the first commit.
Read most (opens and searches):
- `todo.md` 6
- `README.md` 2
- `AGENTS.md` 1
- `CHANGELOG.md` 1
- `docs/decisions.md` 1
- `package.json` 1