Skip to content

perf(runner): list functions with compgen builtin, not declare -F | awk#810

Merged
Chemaclass merged 1 commit into
mainfrom
perf/compgen-function-listing
Jul 16, 2026
Merged

perf(runner): list functions with compgen builtin, not declare -F | awk#810
Chemaclass merged 1 commit into
mainfrom
perf/compgen-function-listing

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Continuing the fork-reduction series (#801-#809). Three call sites captured the defined-function list by piping declare -F through an awk fork.

💡 Changes

  • Use the compgen -A function builtin — identical name-per-line, alphabetical output — so the capture costs only its subshell (5 → 3 awk forks per test file).
  • Shim-based awk fork-budget regression test added. No behaviour change.

Three call sites captured the defined-function list by piping 'declare -F'
through an awk fork. 'compgen -A function' is a bash builtin producing the
identical name-per-line output (both alphabetical), so the capture costs only
its subshell. 5 -> 3 awk forks per test file; the remainder are the per-file
file scans (provider map x2, duplicate check).

No behaviour change.
@Chemaclass Chemaclass added the enhancement New feature or request label Jul 16, 2026
@Chemaclass Chemaclass self-assigned this Jul 16, 2026
@Chemaclass Chemaclass merged commit c76b556 into main Jul 16, 2026
37 checks passed
@Chemaclass Chemaclass deleted the perf/compgen-function-listing branch July 16, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant