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 c5033ad11ca2353ec6c5f1e6c410791c131f9844
Author: Boris Faure <[email protected]>
AuthorDate: Sun Nov 8 12:14:44 2026 +0000

    tests/bench: add a long-lines corpus
    
    Every corpus has lines shorter than a read, and the unicode one puts a
    non-ASCII character every few bytes, so none has a long ASCII run after
    a non-ASCII character within one read. The corpus is lines of 4 to 16
    KiB, as minified JSON or one-line logs, with an accented word 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 4eac1218..27e47028 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.
 
-Eight workloads, chosen so that a change to one part of the intake path shows up
+Nine 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
@@ -22,6 +22,9 @@ in one column rather than being averaged away:
                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.
+  long-lines   lines kilobytes long, as minified JSON or one-line logs, with
+               an accented word now and then. Exercises the ASCII runs that
+               follow a non-ASCII character within one read.
 
 Output is byte-identical across runs (fixed seed, no clock, no locale) so that
 numbers from different days are comparable.
@@ -234,9 +237,28 @@ def gen_insert(target):
     return bytes(out[:cut])
 
 
+def gen_long_lines(target):
+    """Lines of 4 to 16 KiB of words, about one in 200 of them accented."""
+    rng = _rng("long-lines")
+    out = bytearray()
+    while len(out) < target:
+        line = []
+        width = 0
+        limit = rng.randint(4096, 16384)
+        while width < limit:
+            w = rng.choice(WORDS)
+            if rng.random() < 0.005:
+                w = rng.choice(["caf\u00e9", "na\u00efve", "\u00fcber", "se\u00f1or"])
+            line.append(w)
+            width += len(w) + 1
+        out += (" ".join(line) + "\n").encode("utf-8")
+    return bytes(out)
+
+
 GENERATORS = {
     "fill": gen_fill,
     "insert": gen_insert,
+    "long-lines": gen_long_lines,
     "plain-ascii": gen_plain_ascii,
     "rep": gen_rep,
     "scroll": gen_scroll,
diff --git a/tests/meson.build b/tests/meson.build
index 22bac9d9..88e21f3e 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', 'insert', 'plain-ascii', 'rep', 'scroll', 'sgr', 'strings', 'unicode'],
+      output: ['fill', 'insert', 'long-lines', 'plain-ascii', 'rep', 'scroll', 'sgr', 'strings', 'unicode'],
       command: [python3,
                 meson.current_source_dir() / 'bench' / 'gen_corpus.py',
                 '@OUTDIR@'],
@@ -111,6 +111,7 @@ if benchmarks
             args: ['-i', '5',
                    bench_corpus_dir / 'fill',
                    bench_corpus_dir / 'insert',
+                   bench_corpus_dir / 'long-lines',
                    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.

Reply via email to