Using a single
sysread() helps you win a probabilistic scheduling game, where you are competing against other programs that are also trying to move a disk head to fetch data. Moving a disk head is expensive, and if you can get your entire read satisfied with minimal intervening moves, you win. If you block during a
read() and another program (or set of programs) gets requests queued that cause the head to move, you might lose unless the OS is smart enough to be doing read-ahead caching.
If you're the only person on the box, Benchmark tests are rather suspect, since there's not a lot of competition for the disk head. It would be much more interesting to see how the benchmarks differed if you were to run 20 of them simultaneously.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.