DragonFly commits List (threaded) for 2012-02
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]
git: DragonFly_RELEASE_3_0 sh: Use vfork in a few common cases.
commit b4941228cd03b125564fdb6d72755da2a3bbf63e
Author: Peter Avalos <pavalos@dragonflybsd.org>
Date: Sun Feb 5 12:21:25 2012 -0800
sh: Use vfork in a few common cases.
This uses vfork() for simple commands and command substitutions containing a
single simple command, invoking an external program under certain conditions
(no redirections or variable assignments, non-interactive shell, no job
control). These restrictions limit the amount of code executed in a vforked
child.
There is a large speedup (for example 35%) in microbenchmarks. The
difference in buildkernel is smaller (for example 0.5%) but still
statistically significant. See
http://lists.freebsd.org/pipermail/freebsd-hackers/2012-January/037581.html
for some numbers.
The use of vfork() can be disabled by setting a variable named
SH_DISABLE_VFORK.
Obtained-from: FreeBSD 230998
(cherry picked from commit 3fb5edd5046fcd04f359351f47e70ad37816977a)
Summary of changes:
bin/sh/eval.c | 11 ++++++++++-
bin/sh/jobs.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
bin/sh/jobs.h | 3 ++-
bin/sh/var.c | 5 ++++-
bin/sh/var.h | 4 +++-
5 files changed, 69 insertions(+), 5 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b4941228cd03b125564fdb6d72755da2a3bbf63e
--
DragonFly BSD source repository
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]