rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Dave Mason <dmason@plg.uwaterloo.ca>
To: rc@hawkwind.utcs.toronto.edu
Subject: Speed of rc
Date: Fri, 9 Apr 1993 15:22:14 -0400	[thread overview]
Message-ID: <93Apr9.152227edt.28723@plg.uwaterloo.ca> (raw)
In-Reply-To: <199304100239.22248.rc.bagiy@civil.su.oz.au> (john@civil.su.oz.au)

 Ignoring rude comments about my conjectures...

 John is of course right, that in his tests both sh and rc had the
same environments, so the environment copy time will be the same
(although from his numbers it's clear this is a significant cost and
it may be worth looking for a different way to handle environments on
Unix) and we have to look for other differences...

 Well, the obvious one (for me) is that /bin/sh is built to be static,
and when I built rc and es, I took the sun defaults which build
to use dynamic libraries.

So I tried John's test looking at the system calls for static and
dynamic cases... essentially no difference...

But the execution time is very different.  At least on this Sun 4/590,
dynamic libraries cost a lot of system time, and when I run static
versions my rc has virtually identical system times as sh and es only
uses about 7% more system time (which may well be because of the 3
times larger binary and demand-load paging). (And es' *total* time is
within a couple percent of sh.)

John's mileage may vary.  (e.g. if he's not running dynamic libraries.)

Paul & Byron: any idea why the es executable is so large?

../Dave

; /bin/time /bin/sh -c '/bin/cat pus2 | /bin/sh'
; /bin/cat pus2|trace -c /bin/sh

 rc-stat      rc es-stat      es      sh

     90K     82K    286K    163K    106K text+data size

     1.4     2.3     1.1     2.0     4.6 user time
    32.5    44.2    36.0    49.3    32.4 system time
    37.5    49.4    40.9    58.9    40.1 real time

    1059    1068    1007    1064    1076 wait4
    1076    1076    1062    1062    1071 sigblock
    1034    1034    1023    1023    1063 sigstack
    1000    1000    1000    1000    1000 SIGCHLD (20)
    1000    1000    1000    1000     999 fork
      78      78      72      72      14 sigvec
      41      41      38      38       7 sigsetmask
       1       1       1       1       1 exit
       8       8       9       9         brk
       1       1       1       1         getpid
       1       1       1       1         ioctl
       1       1       1       1         getpagesize

(Some or all of the following calls are attributable to Dynamic
libraries):
      33      36       9      12      63 read
       7      14       7      14       4 close
       3      10               7         open
       1       2               1         getuid
       1       2               1         getgid
              10              10         mmap
               4               4         getdents
               2               2         fstat
               1               1         getrlimit

Only rc:
    1000    1000                         stat
       1       1                         getgroups

Only es:
                       3       3         dup
                       1       1         sigcleanup

(As an aside, I find it interesting that there is little correlation
between the number of wait4, sigblock and sigstack calls among the
shells, and I don't see how sh gets 1000 SIGCHLD's with only 999
forks!  But this is repeatable: sh definitely elides the last fork.
Whether that optimization is worthwhile is unclear.)


  reply	other threads:[~1993-04-09 19:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-04-08 22:31 Tom Culliton x2278
1993-04-09  0:38 ` Scott Schwartz
1993-04-09 15:23   ` John Mackin
1993-04-13 19:26     ` Chris Siebenmann
1993-04-13 21:13       ` John Mackin
1993-04-09 16:32   ` Dave Mason
1993-04-09 16:39     ` John Mackin
1993-04-09 19:22       ` Dave Mason [this message]
1993-04-09 21:12         ` Chris Siebenmann
  -- strict thread matches above, loose matches on Subject: below --
1993-04-15 20:26 speed " Tom Culliton x2278
1993-04-13 20:26 Byron Rakitzis
1993-04-13 21:23 ` John Mackin
1993-04-13 23:42   ` mycroft
1993-04-12  5:51 Speed " Paul Haahr
1993-04-09 15:58 Tom Culliton x2278
1993-04-08 23:09 Paul Haahr
1993-04-08 20:14 Byron Rakitzis
1993-04-08 15:45 Paul Haahr
1993-04-07 19:50 Tom Culliton x2278

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93Apr9.152227edt.28723@plg.uwaterloo.ca \
    --to=dmason@plg.uwaterloo.ca \
    --cc=rc@hawkwind.utcs.toronto.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).