Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: clock() in background

Author: Robert Hyatt

Date: 06:42:29 01/26/00

Go up one level in this thread


On January 26, 2000 at 03:05:59, Tom Kerrigan wrote:

>On January 25, 2000 at 23:42:41, Robert Hyatt wrote:
>
>>And if another process uses enough memory to cause you to page a bit, then
>>you get charged for the paging overhead for your page reads/writes.  And if you
>
>I'm not sure this is always correct.
>
>I remember writing a program in Linux a long, long time ago. It did a lot of
>disk accesses. It probably took 3 minutes to run, but at the end of the run,
>clock() reported that the process had only used a few seconds.
>
>-Tom


I didn't say it got charged for the I/O wait time involved.  It gets charged for
the overhead of _doing_ the I/O.  IE allocating a page-sized buffer, etc.  Then
the overhead for switching to another process, then the overhead for switching
back to this process later.

It is easy to see it happen.  just use the shell "time" command to run a
program and run it by itself, then with one (and more) processes. As the number
of page faults goes up, so goes the cpu time.  Not quickly, but enough to make
a 5% variability easy, and for a bigger program, more...

This is why most use a "dedicated" machine to do benchmarking.  And even then
since few operating systems account for the memory-to-cache aliasing problem,
they _still_ get a lot of variability (think about old chess tournaments where
everyone is running/rebooting over and over until they get the NPS value they
want).




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.