[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: _AS_DETECT_BETTER_SHELL speedup
From: |
Alexandre Duret-Lutz |
Subject: |
Re: _AS_DETECT_BETTER_SHELL speedup |
Date: |
Sat, 29 Jan 2005 15:03:53 +0100 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) |
>>> "Noah" == Noah Misch <address@hidden> writes:
Noah> On Sat, Jan 29, 2005 at 02:07:53PM +0100, Alexandre Duret-Lutz wrote:
>> However my understanding is that modern shells already detect
>> these cases and perform the optimization by themselves. I know
>> for sure that Zsh has the machinery for this (along with some
>> other hairy tricks to limit forks at other places), and, from
>> what I can observe from the command line, so does Bash.
Noah> FWIW:
Noah> $ echo $BASH_VERSION
Noah> 2.05b.0(1)-release
Noah> $ strace bash -c '(foo) 2>/dev/null' 2>&1 | grep clone
Noah> clone(child_stack=0,
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x4000fe28)
= 25378
Noah> $ strace bash -c '(exec foo) 2>/dev/null' 2>&1 | grep clone
Noah> clone(child_stack=0,
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x4000fe28)
= 25382
Thanks, I didn't know how to show it.
Noah> $ strace bash -c '{ exec foo; } 2>/dev/null' 2>&1 | grep clone
You probably meant
$ strace bash -c '{ foo; } 2>/dev/null' 2>&1 | grep clone
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0xb7f93bc8) = 19138
Because if you `exec' in {...} it kills the shell executing your script.
--
Alexandre Duret-Lutz
- _AS_DETECT_BETTER_SHELL speedup (was: Re: Proposed doc updates), (continued)
- _AS_DETECT_BETTER_SHELL speedup (was: Re: Proposed doc updates), Stepan Kasal, 2005/01/27
- Re: _AS_DETECT_BETTER_SHELL speedup (was: Re: Proposed doc updates), Ralf Wildenhues, 2005/01/27
- Re: _AS_DETECT_BETTER_SHELL speedup, Paul Eggert, 2005/01/27
- Re: _AS_DETECT_BETTER_SHELL speedup, Ralf Wildenhues, 2005/01/27
- Re: _AS_DETECT_BETTER_SHELL speedup, Paul Eggert, 2005/01/28
- Re: _AS_DETECT_BETTER_SHELL speedup, Stepan Kasal, 2005/01/28
- Re: _AS_DETECT_BETTER_SHELL speedup, Ralf Wildenhues, 2005/01/28
- Re: _AS_DETECT_BETTER_SHELL speedup, Paul Eggert, 2005/01/28
- Re: _AS_DETECT_BETTER_SHELL speedup, Alexandre Duret-Lutz, 2005/01/29
- Re: _AS_DETECT_BETTER_SHELL speedup, Noah Misch, 2005/01/29
- Re: _AS_DETECT_BETTER_SHELL speedup,
Alexandre Duret-Lutz <=
- Re: _AS_DETECT_BETTER_SHELL speedup, Noah Misch, 2005/01/29
- Re: _AS_DETECT_BETTER_SHELL speedup, Stepan Kasal, 2005/01/31
- Re: _AS_DETECT_BETTER_SHELL speedup, Stepan Kasal, 2005/01/31
- Re: _AS_DETECT_BETTER_SHELL speedup, Noah Misch, 2005/01/31
- Re: _AS_DETECT_BETTER_SHELL speedup, Ralf Wildenhues, 2005/01/29
- Re: _AS_DETECT_BETTER_SHELL speedup, Paul Eggert, 2005/01/28
- Re: _AS_DETECT_BETTER_SHELL speedup, Stepan Kasal, 2005/01/29