Presumably all that is happening is that it is only the data in the buffer cache that is changing and so all you are really seeing is the same as modifying a chunk of memory. (I'm presuming you're running Unix here)

For interest I ran it on NT with the following results
Benchmark: timing 3000000 iterations of changestat, openfile... changestat: 4 wallclock secs ( 3.88 usr + -0.02 sys = 3.86 CPU) @ 778 +008.30/s (n=3000000) openfile: 0 wallclock secs ( 1.01 usr + -0.02 sys = 0.99 CPU) @ 3024 +193.55/s (n=3000000)
. This was running on an ancient Pentium 100MHz! - very little disk activity detected so I guess we are seeing caching again. As far as I can tell the whole subject of benchmarking is prone to this sort of behaviour - I think it is very difficult to interpret the results unless you understand what was going on. If the machine was heavily loaded and there was contention for cache then you might see different results.

Have you thought about loading the machine? - You could have a number of processes constantly reading/writing files big enough to cause the cache to be written back to the disk and so hopefully your writes will involve real I/O.

Perhaps once Athena is complete the next project could be a set of benchmarks to facilitate machine and Perl version comparisons - or does such a thing exist already?

In reply to RE: utime vs. open/close by Odud
in thread utime vs. open/close by jjhorner

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.