9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Getting started in Plan9 - help
Date: Mon, 21 Jan 2002 15:21:30 -0500	[thread overview]
Message-ID: <20020121202132.4BD0D199E8@mail.cse.psu.edu> (raw)

First of all, I was kidding about readline.

> * If dynamic linked libraries, you have taken the first step
>   on the slippery slope to the land of gratuitious complexity,
>   where even a simple "hello, world" C program can execute
>   100000 instructions before it actually prints anything.
>   (No, I'm not kidding.)  For some reason, people seem to think
>   adding features in dynamic libraries is "free".

If I'm running rio on Plan 9, draw a new window, and run
hello world, how many instructions execute before I see
"hello world" on my screen?  Lots and lots, just not many
in the hello world process.  The kernel has to redirect
the write into rio, rio does some lookups to figure out
which window gets the output, libdraw has to walk around
in the font caches, possibly loading the missing letters,
(which is more kernel calls, context switches to kfs,
and execution of the various code in devsd), finally
preparing a "draw string" request for /dev/draw.  Then the
kernel is back.  For simplicity let's assume that the window
is in front of all the others, so memlayer isn't involved.  Now we
clear the background, either with memset or by making
calls to an accelerated vga routine with some busy waits
(still faster than memset, though).  Then we use
per-character calls to memimagedraw to blacken the appropriate
pixels.  And finally we see "hello world" (assuming that we
have direct access to video memory; if not, we've been drawing
in a soft screen and still need to flush the changed portion
out to video memory).

You're still right, of course; dynamic libraries are a
slippery slope for lots of reasons.  My point is that the
overhead of dynamic libraries is not necessarily worse than
the overhead of other system services like the kernel and
the various Plan 9 file servers, just in a different place.
It takes far more than 100,000 instructions to get "hello world"
onto my screen either way.  How you count depends on what
you care to include.

Russ


             reply	other threads:[~2002-01-21 20:21 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-21 20:21 Russ Cox [this message]
2002-01-21 20:44 ` Mike Haertel
  -- strict thread matches above, loose matches on Subject: below --
2002-01-24 16:30 Russ Cox
2002-01-24 17:34 ` Thomas Bushnell, BSG
2002-01-23 18:24 Russ Cox
2002-01-24  9:38 ` Thomas Bushnell, BSG
2002-01-22 18:28 David Gordon Hogan
2002-01-23 10:04 ` Douglas A. Gwyn
2002-01-23 18:01   ` Thomas Bushnell, BSG
2002-01-23 18:19     ` Ronald G Minnich
2002-01-23 18:21       ` Scott Schwartz
2002-01-24  9:38       ` Thomas Bushnell, BSG
2002-01-23 18:46     ` Boyd Roberts
2002-01-24  9:38       ` Thomas Bushnell, BSG
2002-01-24 13:01         ` David Arnold
2002-01-24 17:35           ` Thomas Bushnell, BSG
2002-01-24 21:40             ` Dan Cross
2002-01-25 10:00               ` Thomas Bushnell, BSG
2002-01-25 22:56                 ` Dan Cross
2002-01-28 18:26                   ` Boyd Roberts
2002-01-29  9:31                     ` Douglas A. Gwyn
2002-01-24 16:05         ` Boyd Roberts
2002-01-24 17:34           ` Thomas Bushnell, BSG
2002-01-25 10:00     ` Douglas A. Gwyn
2002-01-23 10:48 ` Boyd Roberts
2002-01-23 18:01 ` Thomas Bushnell, BSG
2002-01-22  6:44 okamoto
2002-01-22  2:54 dmr
2002-01-22 11:13 ` Boyd Roberts
2002-01-22 17:39   ` Douglas A. Gwyn
     [not found] <20020121170104.2FABD19A05@mail.cse.psu.edu>
2002-01-21 23:30 ` Andrew Simmons
2002-01-21 22:34 erik quanstrom
2002-01-21 22:15 anothy
2002-01-22  9:53 ` Douglas A. Gwyn
2002-01-21 20:39 Russ Cox
2002-01-21 21:16 ` Matt H
2002-01-21 23:39 ` Quinn Dunkan
2002-01-22 15:36 ` cej
2002-01-22 15:42   ` Matt H
2002-01-22 23:02 ` skipt
2002-01-23 10:05   ` Douglas A. Gwyn
2002-01-23 22:28     ` Lyndon Nerenberg
2002-01-21 20:34 presotto
2002-01-21 19:42 David Gordon Hogan
2002-01-21 20:28 ` Matt H
2002-01-25 10:30   ` Ralph Corderoy
2002-01-21 18:48 Russ Cox
2002-01-21 19:58 ` Mike Haertel
2002-01-21 20:05   ` James A. Robinson
2002-01-21 10:01 Re[2]: " steve.simon
2002-01-21 10:28 ` Boyd Roberts
2002-01-20 21:15 rob pike
2002-01-20 20:02 Roshan James
2002-01-20 21:01 ` Matt H
2002-01-20 22:02   ` Scott Schwartz
2002-01-22  9:54     ` ozan s yigit
2002-01-23 10:05       ` Bakul Shah
2002-01-21 10:22   ` Boyd Roberts
2002-01-21 10:40     ` John Murdie
2002-01-20 21:03 ` William S.
2002-01-20 21:34 ` William Josephson
2002-01-21  6:53 ` cej

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=20020121202132.4BD0D199E8@mail.cse.psu.edu \
    --to=rsc@plan9.bell-labs.com \
    --cc=9fans@cse.psu.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).