Repository navigation
Description
Summary
On #149, a full-display erase checks incoming wraps separately for rows whose predecessor was just cleared. The extra work is visible on redraw-heavy streams. The history-boundary correction in #153 must still hold.
Reproduction
- At the source PR head, run the same byte stream through the public terminal and count predecessor checks.
uv run python - <<'PY'
from cProfile import Profile
from pstats import Stats
from libvt import Terminal
term = Terminal(rows=24, cols=80)
redraw = b"\x1b[H" + b"row0 " * 14 + b"\x1b[0K\r\n" + b"row1 " * 14 + b"\x1b[1K\x1b[2J"
with Profile() as profile:
term.feed(redraw * 400)
print(sum(v[0] for fn, v in Stats(profile).stats.items() if fn[2] == "_sever_incoming_wrap"))
PYExpected
Full-row erases handle the boundary with surviving content once and preserve wrap links, protected cells and snapshot isolation wherever they still matter.
Actual
The probe records 10,000 calls. Seven shuffled single-CPU rounds measured 4.48 MiB/s on master, 3.75 on #149, and 3.85 on #193. These measurements cover the byte stream above.
Environment
Benchmark conditions
Linux aarch64, CPython 3.13.14, 80 columns by 24 rows, one pinned CPU, measurements after warm-up. The integrated head was 4c0bf02.
References
The repeated checks enter in the row clearing change. #153 tracks incoming history wraps and #149 owns the correction. Preserve selective DEC erases, wide-cell boundaries, BCE and held frames. Measure partial erases and unchanged print paths as controls.
Activity