zsh-workers
 help / color / mirror / code / Atom feed
* 101% system resource usage
@ 2004-03-19  0:10 Nikolai Weibull
  2004-03-20  0:02 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Nikolai Weibull @ 2004-03-19  0:10 UTC (permalink / raw)
  To: zsh-workers

It's true!  My system can execute at 101% efficiency!  Sounds like
something taken from michaelscomputers.com [1] perhaps, but here's what
a timing of grep gave:

::: dir: ~ :: user: pcp@puritan :::
time grep -c 'a*' test.file
1
grep -c 'a*' test.file: real: 1.212 user: 1.140 system: 0.090 (101%)
::: dir: ~ :: user: pcp@puritan :::


I don't know if anyone really cares, but there seems to be a seldom
occuring rounding error perhaps?

::: dir: ~ :: user: pcp@puritan :::
zsh --version
zsh 4.2.0-pre-1 (i686-pc-linux-gnu)

If that's of any help.  (Sorry, but don't know if there's any better way
to generate debugging information.)
	nikolai

[1] http://www20.tomshardware.com/column/20040317/index.html

--
::: name: Nikolai Weibull    :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA    :: loc atm: Gothenburg, Sweden    :::
::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}


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

* Re: 101% system resource usage
  2004-03-19  0:10 101% system resource usage Nikolai Weibull
@ 2004-03-20  0:02 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2004-03-20  0:02 UTC (permalink / raw)
  To: Nikolai Weibull, zsh-workers

Nikolai Weibull wrote:
> grep -c 'a*' test.file: real: 1.212 user: 1.140 system: 0.090 (101%)

In fact the calculation (printtime() in jobs.c) always rounds down
(though I'm not sure why it's done the way it is; it effectively
recalculates three floating point numbers it's already calculated).

It may be an artifact of the way the start of real time is only recorded
by the shell after the process is forked (and the end of real time after
it finishes), while the time of process execution is recorded by the
operating system itself and so is more accurate.  If there's a
significant gap due to scheduling the `real' time may be too short.

-- 
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
Work: pws@csr.com
Web: http://www.pwstephenson.fsnet.co.uk


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

end of thread, other threads:[~2004-03-20  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-19  0:10 101% system resource usage Nikolai Weibull
2004-03-20  0:02 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).