From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Haertel Message-Id: <200201212044.g0LKiqK00331@ducky.net> To: 9fans@cse.psu.edu Subject: Re: [9fans] Getting started in Plan9 - help In-Reply-To: <20020121202132.4BD0D199E8@mail.cse.psu.edu> Date: Mon, 21 Jan 2002 12:44:52 -0800 Topicbox-Message-UUID: 4008d794-eaca-11e9-9e20-41e7f4b1d025 >> where even a simple "hello, world" C program can execute >> 100000 instructions before it actually prints anything. > >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, [...] > >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. Under an operating system that will remain nameless, the 100K figure came from using a debugger to count only instructions in the process context of the "hello, world" program itself. It didn't count kernel mode instructions executed, or window system operations in other processes, or any of the plethora of things you mentioned. Had I counted those it of course would have been much higher. Writing to a file or pipe is much cheaper and there the 100K instructions start to stick out like a sore thumb. The reason I bitch and whine about the 100K instructions (or lots more than 100K in some operating systems) is because process startup overhead is one of the main limiting factors to the performance of shell scripts, mkfiles, and the like. That in turn makes people give up on the "tools" approach too soon and too often.