summaryrefslogtreecommitdiffhomepage
path: root/bench/README.md
Commit message (Collapse)AuthorAgeFilesLines
* interactive: one editor, no libraryeditor/one-editorSean Kurtz4 days1-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | libedit was a compile-time alternative (`make EDIT=libedit`). It goes: FreeBSD and NetBSD `sh` use it because it is in their base system, which is not the case on z/OS, and it cost about a third of a millisecond to reach the prompt -- three more shared libraries, `el_init()`, an `~/.editrc` read and a copy of the history -- for the same cost per key. What it bought was `~/.editrc` bindings and a kill ring; `bind` and the built-in editor's own bindings cover the keys, and a second editor meant a second build mode and a second set of interactive expectations, with seven tests skipping under it. Everything that existed only to serve two editors goes with it: the `EDIT` switch and the two `edit_$(EDIT)` paths in the makefile, the `$ZASH_EDITOR` variable the tests used to skip, the skip guards in `tests/linux/`, the NUL stripping in `ptydrive.py` that libedit's redraw needed, and the parallel paragraphs in README.md, DESIGN.md, bench/README.md and the two website pages. `bench/README.md` keeps the measurement, since that is why the decision is written in DESIGN.md. Checked on Linux (97 passed, 1 skipped, the one known local failure in linux/i-dscomplete) and on z/OS (64 passed, 3 skipped, 0 failed, plus the EBCDIC build).
* bench: make the start-up number a minimum of interleaved roundsbench/startup-roundsSean Kurtz4 days1-0/+9
| | | | | | | | | | | | | | | | | | | | | | startup.sh ran BENCH_N starts once, and on the shared z/OS machine the same binary measured anywhere between 5 and 14 ms depending on the hour. Now each cell is the fastest of BENCH_R rounds (default 5) of BENCH_N starts, and a row's two columns are measured one after the other inside each round, so `-c :` and `script` see the same load instead of one following five rounds of the other. A minimum is the right summary because contention only adds time. Measured that way on cbt today, zash is 1.34 ms for `-c :` and 1.36 ms for a script, and the z/OS sh 2.16 and 2.18 — the same two numbers bench/README.md already claimed from a quieter machine, which is the point: the method now reproduces them. Also records the rule the ksh88 constraint implies: where zash and the z/OS sh disagree, zash keeps the better behaviour unless a ksh88 script could observe it, and the one such case — a failed redirection, assignment or read being 2 rather than 1 — is accepted because POSIX does not pin it and the shells disagree among themselves.
* bench: read the 28 differences from the host's shbench/compat-triageSean Kurtz4 days1-3/+31
| | | | | | | | | | | | | | Every script that zash and the IBM sh disagree on has now been read. None is a zash bug: zash matches dash on all 38 (that is what the suite says), and the differences are the IBM shell's — it cannot do `[ a \< b ]`, `fc`, or arithmetic across a newline; it exits where `command eval` should only set a status; it keeps literal quotes inside `${y:-"q r"}` and empty fields from unquoted `$@`; its exit status is 1 for every failure. The one row that is our choice is the status one: the ash family's 2 for a failed redirection, which DESIGN.md already lists and this now records in the table, so that a ksh script on z/OS testing `$?` against 1 is not a surprise.
* bench: measure zash against the sh this host hasbench/host-sh-compatSean Kurtz4 days1-0/+19
| | | | | | | | | | | | `compat.sh` runs every tests/posix script under zash and under another shell, each in an empty directory, and prints the ones whose output or status differ. It is not a test: the .exp files are a reference shell's output, and on z/OS /bin/sh is IBM's ksh-lineage shell with wording and statuses of its own. The count is how close a script naming #!/bin/sh gets to its meaning here; the diffs say which differences to read. On cbt, 10 of the 38 scripts agree and 28 differ, most of them on diagnostics.
* interactive: a prompt's width counts columns, not bytesSean Kurtz4 days1-0/+34
| | | | | | | | | | | | | | | | | | | | | The built-in editor skipped `ESC [ ...` sequences when working out where the prompt ends. Colour and titles are not all CSI: an OSC title or hyperlink runs to BEL or `ESC \`, DCS runs the same way, and `tput sgr0` is the three-byte `ESC ( B` before `ESC [ m`. A prompt built with `$(tput ...)` was measured wrong, which costs the cursor position and with it the wrapped-line arithmetic. `esc_seq_len()` in interact.c now walks what a terminal understands, and edit_builtin.c uses it. The libedit build shares the walk: it brackets control runs for `EL_PROMPT_ESC`, and adds the space libedit needs when a prompt ends in one, since libedit attaches a literal run to the character after it. bench/editor.py measures the two costs run.sh cannot see, start to first prompt and per-key echo, on a pty; bench/README.md has the table. The release, z/OS and fuzz builds move to -O3 while the sanitizer and coverage builds stay low: inlined frames make their reports harder to read than the few percent they would gain.
* docs: the z/OS tables and prose at 64-bit, C23 and the LPASean Kurtz5 days1-52/+69
| | | | | | | | | README's benchmark table is the 64-bit run with the run-time in the LPA and zsh installed (it was the 2.1-era table, and its zsh column was the 31 ms start-up, not zsh). bench/README.md keeps the 2.1 numbers as the history of what the LPA fixed, and gains the start-up table it now has a measurement for. investigation.md's §2 recommendation was still "build 31-bit"; it now says what happened instead.
* build: make the 64-bit z/OS build the defaultSean Kurtz5 days1-20/+33
| | | | | | | | | | | | | | | | | | | | | | zash is built 64-bit on z/OS now: -m64 for the ASCII and the EBCDIC build and for the debug build, and `make` as well as `make zash` land on zos-ascii there. The 31-bit build existed for the 64-bit start and fork costs, which were the C run-time being loaded out of the linklist; with CELQ* in the LPA the widths measure the same and the shell is built at the width IBM builds for. The catalog and dynamic-allocation modules are AMODE 31 and OS_UPSTACK does not exist at -m64, so both are declared with plain OS linkage, which is the 64-bit glue for an AMODE 31 callee. Neither module is installed on the test system, so that path is unverified there; csi_call() still catches a program check and retires the catalog. IGGCSI00's VL bit comes from the width of a pointer, not 0x80000000. Documentation follows: README gains a Recommendations section for the LPA change and loses the 31-bit rationale; DESIGN.md's cost model, catalog linkage and open questions match the measurements; bench/README states the current width and the rerun numbers; investigation.md records the decision.
* docs: name the system by release, not by its hostnameSean Kurtz5 days1-2/+2
|
* bench: the 64-bit start-up cost was the runtime not being in the LPA (#20)Sean Kurtz5 days1-0/+32
| | | | | | | Adding the CELQ members of CEE.SCEERUN2 to the dynamic LPA takes a trivial 64-bit start from 5.83 ms to 1.63 ms, the fork() cost from 4.20 ms to 0.10 ms, and /bin/zsh from 31.4 ms to 3.6 ms. The 27x ratio this repo has been explaining since PR #15 was a system not following IBM's own advice for the 64-bit runtime.
* bench: keep the start-up and fork probes in bench/probesSean Kurtz5 days1-57/+7
| | | | | | | | | The probe sources only existed inline in the docs and in a scratch directory on the z/OS box, so the numbers in bench/README.md could not be reproduced from the repository. fk3.c (fork cost against parent storage), tiny.c (start-up cost) and the HLASM pair tiny31.s/tiny64.s (start-up with no C runtime) now live in bench/probes/, with run.sh building and timing them at both widths; the docs point at them instead of repeating them.
* Measure why 64-bit start-up is slow, and record the answer (#16)Sean Kurtz5 days1-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bench: time one start with a parent that is not an LE program `bench/startup.sh` times a shell loop, so on z/OS every child pays the 31-bit shell's own price and the 64-bit start-up cost cannot be separated from it. `tests/tools/spawn` forks one child at a time and reports wall and child CPU per start, and `bench/le-init.sh` builds the 31-bit, 64-bit and HLASM programs it times in a work directory, so the table needs nothing checked in but the script. The child's environment is built by hand and passed to `execve`: `putenv` after LE has initialized is not handed to the child, and `_CEE_RUNOPTS` exported to an LE parent makes that parent's `execl` fail, which a fork loop that does not check exit status reports as a fast start. * notes: the 64-bit start-up cost is LE waiting, not the address mode Measured on the CBT z/OS 29.00 system: a 64-bit HLASM program with no LE starts in 1.39 ms, the same source at -m32 in 1.5-1.8 ms, so the address space, the loader and XPLINK are free. A -m64 start spends 4.5-28 ms before the first instruction of main, of which only 1.0-1.25 ms is charged to the child: the rest is wall time on something shared, which does not overlap between concurrent starts while it is at 28 ms and does once it drops to 5.8 ms. No _CEE_RUNOPTS option moves it. That retracts an earlier POSIX(OFF) result in these notes: exporting the option to an LE parent makes its execl fail, so the run timed failed execs. Applied to the child, POSIX(OFF) changes nothing.
* bench: start-up table in the README, measured on z/OS and LinuxSean Kurtz5 days1-12/+54
| | | | | | bench/startup.sh had to exist before the README could stop saying the number was missing. On z/OS zash starts in 1.33 ms against 2.20 ms for /bin/sh and 31.4 ms for zsh.
* docs: humanize the markdown docsdocs/startup-probeSean Kurtz6 days1-67/+72
| | | | | | | | | Plain sentences where the prose had decorative bold lead-ins, em dashes and one-line closers. Claims, numbers and commands are unchanged, except two corrections that the startup probe settled: README said the remaining z/OS gap was the price of the address mode, and DESIGN's open question on `a | b &` said the gain depended on the address mode. Both are the 64-bit C run-time, not the address mode.
* docs: keep the probe write-up in notes/investigation.mdSean Kurtz6 days1-25/+7
| | | | | | The assembler-vs-C experiment, its method and the questions it leaves open get a tracked home outside the generated docs/ tree; bench/README keeps the result table and points there.
* docs: the 64-bit start-up cost is LE, not the address modeSean Kurtz6 days1-9/+62
| | | | | | | | | An AMODE 64 HLASM program that returns 0 without any C run-time starts in 0.8 ms, the same as the AMODE 31 copy, while the same empty program in C costs 29.4 ms at -m64 and 2.0 ms at -m32. So the 28 ms is Language Environment's 64-bit initialization, not the address space, and the 31-bit LE start is about 1 ms. Records the probe and corrects the claims in bench/README.md and DESIGN.md.
* bench: name the baseline shell /bin/sh, not ksh88, in prosedocs/readme-currentSean Kurtz6 days1-3/+3
|
* bench: label the z/OS baseline column "z/OS sh"Sean Kurtz6 days1-1/+1
|
* z/OS: run 31-bit and load IGGCSI00 through the C librarySean Kurtz7 days1-0/+297
zash was AMODE 64, so calling the AMODE 31 IGGCSI00 needed assembler glue (zos_csi.s) that switched addressing mode around the branch. Built with -m32 the program is 31-bit itself: the call goes through a plain function pointer, the work area and the saved registers live in one 31-bit block in C, and the glue is gone. The rest of the tree follows the change: the build, the off-z/OS lint shim, DESIGN.md and README.md, the benches, the Lean spec of the pattern matcher, and the tests that recorded what the extra address bits had changed.