dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC dash 0/4] Avoid a fork before running last command given to -c
@ 2011-04-10  7:18 Jonathan Nieder
  2011-04-10  7:21 ` [PATCH 1/4] [INPUT] Introduce preadateof predicate to check for end of input Jonathan Nieder
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Jonathan Nieder @ 2011-04-10  7:18 UTC (permalink / raw)
  To: dash; +Cc: Jilles Tjoelker, Drake Wilson, Reuben Thomas

Hi,

Jilles Tjoelker wrote[0]:

> Regarding sh -c optimization, I am in favour of this. Uselessly waiting
> 'sh -c' processes annoy me. I made the change for FreeBSD 8.0 sh, which
> is very similar to dash. The SVN changeset is r194128.

So I grabbed that changeset with

	svn log -v svn://svn.freebsd.org/base/head/bin/sh -r 194128
	svn diff -r 194127:194128 svn://svn.freebsd.org/base/head/bin/sh

and made it a tiny bit smaller.   Here's the result.

   text    data     bss     dec     hex filename
  83994    1784   11128   96906   17a8a dash.before-O2
  83994    1784   11128   96906   17a8a dash.before-Os
  84146    1784   11128   97058   17b22 dash.after-O2
  84146    1784   11128   97058   17b22 dash.after-Os

On this amd64 the cost is 152 bytes of text.  Thoughts?

[0] http://bugs.debian.org/436466

Jilles Tjoelker (4):
  [INPUT] Introduce preadateof predicate to check for end of input
  [EVAL] Make eval flags public
  [EVAL] Take advantage of EV_EXIT in evalstring
  [MAIN] Optimize dash -c "command" to avoid a fork

 src/eval.c  |   11 +++++------
 src/eval.h  |    5 +++++
 src/input.c |   17 +++++++++++++++++
 src/input.h |    1 +
 src/main.c  |    2 +-
 5 files changed, 29 insertions(+), 7 deletions(-)

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-07-07  8:39 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-10  7:18 [PATCH/RFC dash 0/4] Avoid a fork before running last command given to -c Jonathan Nieder
2011-04-10  7:21 ` [PATCH 1/4] [INPUT] Introduce preadateof predicate to check for end of input Jonathan Nieder
2011-04-10  7:22 ` [PATCH 2/4] [EVAL] Make eval flags public Jonathan Nieder
2011-04-10  7:35 ` [PATCH 3/4] [EVAL] Take advantage of EV_EXIT in evalstring Jonathan Nieder
2011-04-10  7:36 ` [PATCH 4/4] [MAIN] Optimize dash -c "command" to avoid a fork Jonathan Nieder
2011-07-07  3:48   ` Herbert Xu
2011-07-07  4:27     ` Jonathan Nieder
2011-07-07  4:57       ` Herbert Xu
2011-07-07  5:56         ` Herbert Xu
2011-07-07  7:48           ` Jonathan Nieder
2011-07-07  8:22             ` Herbert Xu
2011-07-07  8:37               ` Jonathan Nieder
2011-07-07  8:39                 ` Herbert Xu
2011-04-10  7:38 ` [PATCH 5/4] [EVAL] Remove unused EV_BACKCMD flag Jonathan Nieder
2011-07-07  3:56   ` Herbert Xu
2011-04-15 13:07 ` [PATCH/RFC dash 0/4] Avoid a fork before running last command given to -c Herbert Xu
2011-04-17 22:13   ` Jilles Tjoelker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).