This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch tymux-10-quiet-head
in repository terminology.
View the commit online.
commit 15be6041e89cb7211c6bacc3b344f55c67aca2d0
Author: Boris Faure <[email protected]>
AuthorDate: Sat Nov 7 19:48:48 2026 +0000
tests/bench: add an insert corpus
No corpus used ICH or DECIC, so tybench could not measure a change to
the in-row shifts. The corpus is ICH of random counts at random
positions, as editors open room for typed text, with a DECIC now and
then.
---
tests/bench/gen_corpus.py | 24 +++++++++++++++++++++++-
tests/meson.build | 3 ++-
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/tests/bench/gen_corpus.py b/tests/bench/gen_corpus.py
index 55599a03..4eac1218 100644
--- a/tests/bench/gen_corpus.py
+++ b/tests/bench/gen_corpus.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""Generate deterministic benchmark corpora for tybench.
-Seven workloads, chosen so that a change to one part of the intake path shows up
+Eight workloads, chosen so that a change to one part of the intake path shows up
in one column rather than being averaged away:
plain-ascii long lines of printable ASCII, almost no escapes. The pure
@@ -20,6 +20,8 @@ in one column rather than being averaged away:
when terminfo has rep. Exercises the REP expansion.
fill DECFRA rectangles under default and set colours, and DECALN.
Exercises the rectangle and screen fills.
+ insert ICH (CSI @) on a row, as editors open room for typed text, and
+ DECIC (CSI ' }) now and then. Exercises the in-row shifts.
Output is byte-identical across runs (fixed seed, no clock, no locale) so that
numbers from different days are comparable.
@@ -213,8 +215,28 @@ def gen_fill(target):
return bytes(out[:cut]) + b"\033[0m\n"
+def gen_insert(target):
+ """Cursor moves, an ICH or a DECIC of random count, then a word."""
+ rng = _rng("insert")
+ out = bytearray()
+ cut = 0
+ while len(out) < target:
+ final = "'}" if rng.random() < 0.05 else "@"
+ seq = "\033[%d;%dH\033[%d%s%s" % (rng.randint(1, 24), rng.randint(1, 80),
+ rng.randint(1, 80), final,
+ rng.choice(WORDS))
+ out += seq.encode("ascii")
+ # Whole sequences only, as in gen_sgr.
+ if len(out) <= target:
+ cut = len(out)
+ if cut == 0:
+ cut = len(out)
+ return bytes(out[:cut])
+
+
GENERATORS = {
"fill": gen_fill,
+ "insert": gen_insert,
"plain-ascii": gen_plain_ascii,
"rep": gen_rep,
"scroll": gen_scroll,
diff --git a/tests/meson.build b/tests/meson.build
index 7aaba949..22bac9d9 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -99,7 +99,7 @@ if benchmarks
# generator is deterministic so the bytes are reproducible. It writes to
# @OUTDIR@ so that what it produces is what 'output' declares.
bench_corpus = custom_target('bench-corpus',
- output: ['fill', 'plain-ascii', 'rep', 'scroll', 'sgr', 'strings', 'unicode'],
+ output: ['fill', 'insert', 'plain-ascii', 'rep', 'scroll', 'sgr', 'strings', 'unicode'],
command: [python3,
meson.current_source_dir() / 'bench' / 'gen_corpus.py',
'@OUTDIR@'],
@@ -110,6 +110,7 @@ if benchmarks
tybench,
args: ['-i', '5',
bench_corpus_dir / 'fill',
+ bench_corpus_dir / 'insert',
bench_corpus_dir / 'plain-ascii',
bench_corpus_dir / 'rep',
bench_corpus_dir / 'scroll',
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.