mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-12 11:48:29 +01:00
Answer prose round 1: 0 🔴, 4 🟡; cut the decisions entry to what was kept, split the changelog bullet, and drop the item 120 tagline's clause
This commit is contained in:
+4
-4
@@ -21,10 +21,10 @@
|
||||
directive's `[content]`. Such a text took time quadratic in its length: 160000 characters of `<?`
|
||||
took seven seconds each way, now 50 ms.
|
||||
- Every reader takes time linear in the markdown when it holds blank lines under list items nested
|
||||
deeply, and `losslessMarkdownToAdf` when it holds many unclosed backtick runs inside an inline
|
||||
directive's `[content]`. Such a list is still refused as `unsupported-nesting-depth`, now after
|
||||
40 ms where 20000 nested items and as many blank lines took 10.7 seconds; 640000 characters of
|
||||
backtick runs in a directive took one second, now 100 ms.
|
||||
deeply. Such a list is still refused as `unsupported-nesting-depth`, now after 40 ms where 20000
|
||||
nested items and as many blank lines took 10.7 seconds.
|
||||
- `losslessMarkdownToAdf` takes time linear in the markdown when an inline directive's `[content]`
|
||||
holds many unclosed backtick runs: 640000 characters of them took one second, now 100 ms.
|
||||
- The README compares the package with seven other ADF converters, each checked against its
|
||||
published version.
|
||||
|
||||
|
||||
+2
-4
@@ -827,10 +827,8 @@ A cost fix that changes no behaviour lands on the suite staying green with no fi
|
||||
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. 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, which took 20000 nested items and as many blank lines from 10.7 s to 39 ms; and an item
|
||||
reads a line's indentation only up to its own width, though a tab an item's width splits still
|
||||
costs the whole line at each level (`todo.md` item 120).
|
||||
so it doesn't bound the walk's cost. Kept: where an item's width falls inside a tab, each level still
|
||||
copies the whole line (`todo.md` item 120).
|
||||
|
||||
## Only the hard break holds a raw newline
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ClaimedPrefix } from './directive-syntax.ts'
|
||||
import type { CodeSpanCloser } from './commonmark/backtick-runs.ts'
|
||||
import type { Claims } from './portable/conventions.ts'
|
||||
import type { CodeSpanCloser } from './commonmark/backtick-runs.ts'
|
||||
import { backslashEscape, inlineHtmlConstruct, readBracketedAutolink, readEmailAutolink } from './commonmark/grammar.ts'
|
||||
import { backtickCloser, backtickRun } from './commonmark/backtick-runs.ts'
|
||||
import { claimDirectivePrefix } from './directive-syntax.ts'
|
||||
|
||||
@@ -606,7 +606,7 @@ function sourceLine(markdown: string, line: number, start: number, end: number):
|
||||
return { position: { line, offset: start }, text: replaceNullCharacters(markdown.slice(start, end)) }
|
||||
}
|
||||
|
||||
// Counting stops at `upTo` columns, so a test against a width costs the width, not the line's whole indentation.
|
||||
// `upTo` caps the cost: checking a line against an item's width reads at most that width.
|
||||
function leadingColumns(line: Line, upTo = Infinity): number {
|
||||
let columns = 0
|
||||
for (const character of line.text) {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |
|
||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||
| 120 | 0.3.0 | | defect | **Read a tab-indented line under nested list items in time linear in the line, where today a tab an item's width splits copies the whole line at each level.** | 2 | 1 | 2 | 3 | 3 | 9 by 2 | 6.0 |
|
||||
| 120 | 0.3.0 | | defect | **Read a tab-indented line under nested list items in time linear in the line.** | 2 | 1 | 2 | 3 | 3 | 9 by 2 | 6.0 |
|
||||
| 115 | 0.3.0 | | defect | **Build text holding no `border` mark in `losslessMarkdownToAdf`, and have `adfToLosslessMarkdown` carry text holding one.** | 2 | 1 | 2 | 3 | 3 | 4 by 3 | 4.5 |
|
||||
| 100 | 0.3.0 | | decision | **Put the reading of an image's title as its caption back to a reader panel, now that a writer panel reads a title as hover text.** | 1 | 2 | 2 | 3 | 3 | 6 by 4 | 4.0 |
|
||||
| 33 | 0.3.0 | | defect | **Emit a line in time linear in its mark runs, in `adfToLosslessMarkdown` and `adfToPortableMarkdown`.** | 3 | 1 | 2 | 4 | 5 | 9 by 3 | 3.6 |
|
||||
@@ -58,16 +58,16 @@
|
||||
|
||||
## Details
|
||||
|
||||
### 120. Read a tab-indented line under nested list items in time linear in the line, where today a tab an item's width splits copies the whole line at each level.
|
||||
### 120. Read a tab-indented line under nested list items in time linear in the line.
|
||||
|
||||
`removeColumns` in `src/markdown/parse/blocks.ts` returns `' '.repeat(n) + line.text.slice(index)`
|
||||
where an item's width splits a tab, a fresh string, so the next level's `slice` copies the whole
|
||||
line instead of sharing it. Measured on 2026-10-18 on 20 tab-indented lines under 20000, 40000 and
|
||||
80000 nested list items: 176, 460 and 1812 ms, where the same lines indented with spaces took 73, 90
|
||||
and 173 ms. Keep the split tab's leftover columns as a number on `Line` beside `column` and `text`,
|
||||
so a cut never builds a string. `docs/decisions.md` §Cost fixes are measured, never timed names
|
||||
this exception (cites item 120); delete that clause with the fix. Found while reviewing item 98's
|
||||
chunk, 2026-10-18.
|
||||
where an item's width ends inside a tab, a fresh string, so the next level's `slice` copies the
|
||||
whole line instead of sharing it. Measured on 2026-10-18 on 20 tab-indented lines under 20000,
|
||||
40000 and 80000 nested list items: 176, 460 and 1812 ms, where the same lines indented with spaces
|
||||
took 73, 90 and 173 ms. Keep the split tab's leftover columns as a number on `Line` beside `column`
|
||||
and `text`, so a cut never builds a string. Delete the clause naming this item from
|
||||
`docs/decisions.md` §Cost fixes are measured, never timed. Found while reviewing item 98's chunk,
|
||||
2026-10-18.
|
||||
|
||||
### 115. Build text holding no `border` mark in `losslessMarkdownToAdf`, and have `adfToLosslessMarkdown` carry text holding one.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user