Skip to content

perf(dispatch): hoist case word, merge test Vecs, memoize at-join - #921

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/dispatch-outliers
Oct 20, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/dispatch-outliers

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Dispatch outliers: (a) case word Vec hoisted out of per-arm loop, byte-scan extglob check, static-literal gate untouched (#117 whitelist); GNU execute_cmd.c:3644. (b) test: drop stripped Vec, single-pass -v rewrite + -t detect, skip sync_fd_terminal_marks without -t; GNU test.c. (c) at-join via indexed_array_entries_cached, skip identity normalize clone, IFS first-char hoisted; GNU subst.c:2902/2864. Tests: lib 636 + cli 467 green. Bench (debug build, needs release re-measure).

(a) case: stage word Vec<char> once outside arm loop, add
with_word_chars matchers (GNU execute_cmd.c:3644 execute_case_command,
word via expand_word_leave_quoted+dequote_string 3695-3699 reused
per-arm strmatch 3736); zero-alloc case_pattern_has_extglob byte scan.
Static-literal gate untouched whitelist (rubash#117).

(b) test: single merged Vec, fused -t detect, pointer-merge
overrides with early exit; no stripped Vec, no per-index find;
execute_with_stderr takes &[&str] (GNU test.c test_command argv
in place); keep skip sync_fd_terminal_marks without -t
(builtins/test.c: only -t probes terminal).

(c) at-join: indexed via indexed_array_entries_cached memo,
skip identity normalize clone, hoist ifs_firstchar separator
once (GNU subst.c:2902 string_list_dollar_star, 2864 ifs_firstchar;
array order array.c/hashlib.c).

bench best-of-3 (debug): case 0.643s shift 1.117s test 0.687s int 0.580s
@caomengxuan666
caomengxuan666 merged commit ef36b6d into master Oct 20, 2026
8 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/dispatch-outliers branch October 20, 2026 15:34
caomengxuan666 added a commit that referenced this pull request Nov 5, 2026
…ssembly faces read 1 (Refs #2833)

The GAP-13 host lane landed (niu #921, merge `9388c9cf`):
`bind_surface.rs` is deleted and niubash production refs to the
`bind_registry` types are 0. This record closes the two ledger
items the entity wave parked:

- §6: delete the `BindEntry` / `BindKind` / `KEYMAP_NAMES` items
  plus the three `BindKind` variants (284 → 278 symbols).
- §2.1: the `shell::bind_registry` row is rewritten as exited
  (kill-row precedent) — the 23-reference consumption claim is
  gone; the exit record keeps the audit trail.
- §2.3: `Session::register_binding` / `initialize_readline` /
  `is_known_keymap` read 1 each at production caliber
  (`shell.rs:3197`, `shell.rs:3164`, `repl.rs:5276`; the two
  test-module `is_known_keymap` calls are noted, not counted).
- §4: the bind_registry row is annotated retired (GAP-13).
- Header addendum records the wave (284 → 278).

Checker: `--self-test` green, presence 278/278,
`--niu` (niu master `9388c9cf`) green — all 97 consumed paths
recorded. The 6 remaining `recorded but not consumed` warnings
are the pre-existing stale items, left for the next bookkeeping
wave (not this lane's).

本 PR 删除了什么:
- §6 的 `BindEntry` / `BindKind` / `KEYMAP_NAMES` 项 + 3 个
  `BindKind` 变体(共 6 行)。
- §2.1 `shell::bind_registry` 行的消费陈述(23 引用 + KEYMAP_NAMES),
  改为退出记录(行本身保留,依 kill 行先例)。

净行数:+17/−11(净 +6),仅 `docs/api-ledger.md`。

Refs: #2833, unixwin/niubash#863, unixwin/niubash#921.
caomengxuan666 added a commit that referenced this pull request Nov 5, 2026
…ssembly faces read 1 (Refs #2833) (#2852)

The GAP-13 host lane landed (niu #921, merge `9388c9cf`):
`bind_surface.rs` is deleted and niubash production refs to the
`bind_registry` types are 0. This record closes the two ledger
items the entity wave parked:

- §6: delete the `BindEntry` / `BindKind` / `KEYMAP_NAMES` items
  plus the three `BindKind` variants (284 → 278 symbols).
- §2.1: the `shell::bind_registry` row is rewritten as exited
  (kill-row precedent) — the 23-reference consumption claim is
  gone; the exit record keeps the audit trail.
- §2.3: `Session::register_binding` / `initialize_readline` /
  `is_known_keymap` read 1 each at production caliber
  (`shell.rs:3197`, `shell.rs:3164`, `repl.rs:5276`; the two
  test-module `is_known_keymap` calls are noted, not counted).
- §4: the bind_registry row is annotated retired (GAP-13).
- Header addendum records the wave (284 → 278).

Checker: `--self-test` green, presence 278/278,
`--niu` (niu master `9388c9cf`) green — all 97 consumed paths
recorded. The 6 remaining `recorded but not consumed` warnings
are the pre-existing stale items, left for the next bookkeeping
wave (not this lane's).

本 PR 删除了什么:
- §6 的 `BindEntry` / `BindKind` / `KEYMAP_NAMES` 项 + 3 个
  `BindKind` 变体(共 6 行)。
- §2.1 `shell::bind_registry` 行的消费陈述(23 引用 + KEYMAP_NAMES),
  改为退出记录(行本身保留,依 kill 行先例)。

净行数:+17/−11(净 +6),仅 `docs/api-ledger.md`。

Refs: #2833, unixwin/niubash#863, unixwin/niubash#921.

Co-authored-by: 曹梦轩 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant