diff options
| author | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-19 17:37:25 -0600 |
|---|---|---|
| committer | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-19 17:37:25 -0600 |
| commit | f5f5683fc23876e66bdf31ba72ce6df3d430fc1b (patch) | |
| tree | 5dbf20af2cb8f74a3d61c2fc8dfe4653a0b6f904 /bench/git@git.abendless.com:/srv/git | |
| parent | b0c99064d0a3eb344fd07a6220f3fd4422bfab7f (diff) | |
| download | zash-f5f5683fc23876e66bdf31ba72ce6df3d430fc1b.tar.gz | |
exec: run a subshell in process when its body cannot change anything
A `fork()` copies the address space on z/OS, where a `spawn()` can share
it. The subshell row measured 4.7 ms a turn there against 0.3 ms for an
external command, and ksh88 does not fork for `( : )` at all.
The pipeline stage check already answered the safety question with
is_pure(), so a subshell whose body is one output-only builtin with no
redirections and no assignments reuses the answer and runs in the shell.
Expansion of the arguments is wrapped in the same capture scope a
pipeline stage uses, so ${x=1} no longer escapes.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'bench/git@git.abendless.com:/srv/git')
0 files changed, 0 insertions, 0 deletions
