You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7e8754d
Browse filesBrowse the repository at this point in the historyBrowse files
perf: avoid repeated raw string copies in nested lists (#4082)
fix: avoid repeated raw string copies in nested lists
Tokenizer.list() built each item's raw by appending line by line, and the
list's raw by concatenating its items. src is only ever consumed from the
front, so both are contiguous spans of the input and can be sliced out of
it instead. V8 keeps a slice as a view on one backing string rather than a
fresh copy per list and per item.
Token values are unchanged. On cmark's pathological "deeply nested lists"
case (500 levels): 222 MB RSS and 135 ms before, 157 MB and 126 ms after.
No change on the CommonMark spec corpus -- the saving is proportional to
nesting depth, so ordinary documents are unaffected.
0 commit comments