home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume17 / iozone / part01 next >
SHell self-extracting ARchive  |  1991-03-23  |  10.8 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: SHell self-extracting ARchive (archive/shar).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news or mail text default
99% file C source, ASCII text default
100% TrID E-Mail message (Var. 2) default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/rfc822 default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 6e 6f | 72 63 6f 74 74 40 64 61 |From: no|rcott@da|
|00000010| 74 61 62 73 2e 65 6e 65 | 74 2e 64 65 63 2e 63 6f |tabs.ene|t.dec.co|
|00000020| 6d 20 28 42 69 6c 6c 20 | 4e 6f 72 63 6f 74 74 29 |m (Bill |Norcott)|
|00000030| 0a 4e 65 77 73 67 72 6f | 75 70 73 3a 20 63 6f 6d |.Newsgro|ups: com|
|00000040| 70 2e 73 6f 75 72 63 65 | 73 2e 6d 69 73 63 0a 53 |p.source|s.misc.S|
|00000050| 75 62 6a 65 63 74 3a 20 | 76 31 37 69 30 36 35 3a |ubject: |v17i065:|
|00000060| 20 20 69 6f 7a 6f 6e 65 | 20 2d 20 73 65 71 75 65 | iozone| - seque|
|00000070| 6e 74 69 61 6c 20 66 69 | 6c 65 20 49 2f 4f 20 62 |ntial fi|le I/O b|
|00000080| 65 6e 63 68 6d 61 72 6b | 20 66 6f 20 55 4e 49 58 |enchmark| fo UNIX|
|00000090| 2c 20 56 4d 53 20 26 20 | 44 4f 53 2c 20 50 61 72 |, VMS & |DOS, Par|
|000000a0| 74 30 31 2f 30 31 0a 4d | 65 73 73 61 67 65 2d 49 |t01/01.M|essage-I|
|000000b0| 44 3a 20 3c 31 39 39 31 | 4d 61 72 32 32 2e 32 31 |D: <1991|Mar22.21|
|000000c0| 32 38 34 36 2e 31 36 38 | 33 35 40 73 70 61 72 6b |2846.168|35@spark|
|000000d0| 79 2e 49 4d 44 2e 53 74 | 65 72 6c 69 6e 67 2e 43 |y.IMD.St|erling.C|
|000000e0| 4f 4d 3e 0a 44 61 74 65 | 3a 20 32 32 20 4d 61 72 |OM>.Date|: 22 Mar|
|000000f0| 20 39 31 20 32 31 3a 32 | 38 3a 34 36 20 47 4d 54 | 91 21:2|8:46 GMT|
|00000100| 0a 41 70 70 72 6f 76 65 | 64 3a 20 6b 65 6e 74 40 |.Approve|d: kent@|
|00000110| 73 70 61 72 6b 79 2e 69 | 6d 64 2e 73 74 65 72 6c |sparky.i|md.sterl|
|00000120| 69 6e 67 2e 63 6f 6d 0a | 58 2d 43 68 65 63 6b 73 |ing.com.|X-Checks|
|00000130| 75 6d 2d 53 6e 65 66 72 | 75 3a 20 64 39 39 63 31 |um-Snefr|u: d99c1|
|00000140| 33 30 62 20 30 32 38 39 | 30 39 39 62 20 33 38 33 |30b 0289|099b 383|
|00000150| 64 36 39 33 34 20 30 39 | 63 37 30 36 35 34 0a 0a |d6934 09|c70654..|
|00000160| 53 75 62 6d 69 74 74 65 | 64 2d 62 79 3a 20 42 69 |Submitte|d-by: Bi|
|00000170| 6c 6c 20 4e 6f 72 63 6f | 74 74 20 3c 6e 6f 72 63 |ll Norco|tt <norc|
|00000180| 6f 74 74 40 64 61 74 61 | 62 73 2e 65 6e 65 74 2e |ott@data|bs.enet.|
|00000190| 64 65 63 2e 63 6f 6d 3e | 0a 50 6f 73 74 69 6e 67 |dec.com>|.Posting|
|000001a0| 2d 6e 75 6d 62 65 72 3a | 20 56 6f 6c 75 6d 65 20 |-number:| Volume |
|000001b0| 31 37 2c 20 49 73 73 75 | 65 20 36 35 0a 41 72 63 |17, Issu|e 65.Arc|
|000001c0| 68 69 76 65 2d 6e 61 6d | 65 3a 20 69 6f 7a 6f 6e |hive-nam|e: iozon|
|000001d0| 65 2f 70 61 72 74 30 31 | 0a 0a 41 74 74 61 63 68 |e/part01|..Attach|
|000001e0| 65 64 20 69 73 20 61 20 | 62 65 6e 63 68 6d 61 72 |ed is a |benchmar|
|000001f0| 6b 20 63 61 6c 6c 65 64 | 20 49 4f 7a 6f 6e 65 20 |k called| IOzone |
|00000200| 77 68 69 63 68 20 49 20 | 68 61 76 65 20 77 72 69 |which I |have wri|
|00000210| 74 74 65 6e 2e 20 20 49 | 74 20 77 61 73 20 69 6e |tten. I|t was in|
|00000220| 73 70 69 72 65 64 0a 62 | 79 20 41 6c 76 69 6e 20 |spired.b|y Alvin |
|00000230| 50 61 72 6b 27 73 20 49 | 4f 73 74 6f 6e 65 20 62 |Park's I|Ostone b|
|00000240| 65 6e 63 68 6d 61 72 6b | 20 28 77 68 69 63 68 20 |enchmark| (which |
|00000250| 74 65 73 74 73 20 72 61 | 6e 64 6f 6d 20 61 63 63 |tests ra|ndom acc|
|00000260| 65 73 73 20 49 2f 4f 29 | 2e 20 20 49 4f 7a 6f 6e |ess I/O)|. IOzon|
|00000270| 65 0a 74 65 73 74 73 20 | 73 65 71 75 65 6e 74 69 |e.tests |sequenti|
|00000280| 61 6c 20 66 69 6c 65 20 | 49 2f 4f 20 75 73 69 6e |al file |I/O usin|
|00000290| 67 20 74 68 65 20 43 20 | 6c 61 6e 67 75 61 67 65 |g the C |language|
|000002a0| 2e 20 20 49 74 20 77 72 | 69 74 65 73 2c 20 74 68 |. It wr|ites, th|
|000002b0| 65 6e 20 72 65 61 64 73 | 2c 20 61 0a 73 65 71 75 |en reads|, a.sequ|
|000002c0| 65 6e 74 69 61 6c 20 66 | 69 6c 65 20 6f 66 20 66 |ential f|ile of f|
|000002d0| 69 78 65 64 20 6c 65 6e | 67 74 68 20 72 65 63 6f |ixed len|gth reco|
|000002e0| 72 64 73 2c 20 61 6e 64 | 20 6d 65 61 73 75 72 65 |rds, and| measure|
|000002f0| 73 20 74 68 65 20 72 65 | 61 64 20 26 20 77 72 69 |s the re|ad & wri|
|00000300| 74 65 0a 72 61 74 65 73 | 20 69 6e 20 62 79 74 65 |te.rates| in byte|
|00000310| 73 20 70 65 72 20 73 65 | 63 6f 6e 64 2e 20 20 54 |s per se|cond. T|
|00000320| 68 65 20 64 65 66 61 75 | 6c 74 20 69 73 20 74 6f |he defau|lt is to|
|00000330| 20 63 72 65 61 74 65 20 | 61 20 31 20 6d 65 67 61 | create |a 1 mega|
|00000340| 62 79 74 65 20 66 69 6c | 65 20 0a 63 6f 6e 73 69 |byte fil|e .consi|
|00000350| 73 74 69 6e 67 20 6f 66 | 20 32 30 34 38 2c 20 35 |sting of| 2048, 5|
|00000360| 31 32 2d 62 79 74 65 20 | 72 65 63 6f 72 64 73 20 |12-byte |records |
|00000370| 2d 2d 20 68 6f 77 65 76 | 65 72 2c 20 74 68 65 73 |-- howev|er, thes|
|00000380| 65 20 70 61 72 61 6d 65 | 74 65 72 73 20 63 61 6e |e parame|ters can|
|00000390| 20 62 65 0a 63 68 61 6e | 67 65 64 20 66 72 6f 6d | be.chan|ged from|
|000003a0| 20 74 68 65 20 63 6f 6d | 6d 61 6e 64 20 6c 69 6e | the com|mand lin|
|000003b0| 65 2e 20 20 4f 6e 20 55 | 4e 49 58 20 73 79 73 74 |e. On U|NIX syst|
|000003c0| 65 6d 73 2c 20 74 68 65 | 20 72 65 73 75 6c 74 73 |ems, the| results|
|000003d0| 20 77 69 6c 6c 20 62 65 | 20 69 6e 66 6c 75 65 6e | will be| influen|
|000003e0| 63 65 64 0a 62 79 20 74 | 68 65 20 65 66 66 65 63 |ced.by t|he effec|
|000003f0| 74 20 6f 66 20 74 68 65 | 20 62 75 66 66 65 72 20 |t of the| buffer |
|00000400| 63 61 63 68 65 20 2d 2d | 20 68 6f 77 65 76 65 72 |cache --| however|
|00000410| 2c 20 77 65 20 63 61 6e | 20 6c 61 72 67 65 6c 79 |, we can| largely|
|00000420| 20 6e 65 67 61 74 65 20 | 74 68 65 0a 65 66 66 65 | negate |the.effe|
|00000430| 63 74 20 6f 66 20 63 61 | 63 68 69 6e 67 20 62 79 |ct of ca|ching by|
|00000440| 20 75 73 69 6e 67 20 61 | 20 66 69 6c 65 20 73 69 | using a| file si|
|00000450| 7a 65 20 67 72 65 61 74 | 65 72 20 74 68 61 6e 20 |ze great|er than |
|00000460| 74 77 69 63 65 20 74 68 | 65 20 73 69 7a 65 20 6f |twice th|e size o|
|00000470| 66 20 74 68 65 0a 63 61 | 63 68 65 2e 20 20 54 68 |f the.ca|che. Th|
|00000480| 69 73 20 77 69 6c 6c 20 | 61 6c 6c 6f 77 20 61 20 |is will |allow a |
|00000490| 66 61 69 72 65 72 20 63 | 6f 6d 70 61 72 69 73 6f |fairer c|ompariso|
|000004a0| 6e 20 62 65 74 77 65 65 | 6e 20 76 61 72 69 6f 75 |n betwee|n variou|
|000004b0| 73 20 64 69 73 6b 20 64 | 72 69 76 65 73 20 0a 61 |s disk d|rives .a|
|000004c0| 74 74 61 63 68 65 64 20 | 74 6f 20 74 68 65 20 73 |ttached |to the s|
|000004d0| 79 73 74 65 6d 2e 20 20 | 49 4f 7a 6f 6e 65 20 49 |ystem. |IOzone I|
|000004e0| 53 20 4e 4f 54 20 61 20 | 64 69 72 65 63 74 20 74 |S NOT a |direct t|
|000004f0| 65 73 74 20 6f 66 20 64 | 69 73 6b 20 70 65 72 66 |est of d|isk perf|
|00000500| 6f 72 6d 61 6e 63 65 2e | 20 20 49 74 73 0a 72 65 |ormance.| Its.re|
|00000510| 73 75 6c 74 73 20 61 72 | 65 20 61 20 63 6f 6d 62 |sults ar|e a comb|
|00000520| 69 6e 61 74 69 6f 6e 20 | 6f 66 20 64 69 73 6b 20 |ination |of disk |
|00000530| 73 70 65 65 64 2c 20 43 | 50 55 20 73 70 65 65 64 |speed, C|PU speed|
|00000540| 2c 20 61 6d 6f 75 6e 74 | 20 6f 66 20 63 61 63 68 |, amount| of cach|
|00000550| 65 2c 20 61 6e 64 20 74 | 68 65 0a 65 66 66 69 63 |e, and t|he.effic|
|00000560| 69 65 6e 63 79 20 6f 66 | 20 74 68 65 20 43 20 63 |iency of| the C c|
|00000570| 6f 6d 70 69 6c 65 72 20 | 26 20 72 75 6e 74 69 6d |ompiler |& runtim|
|00000580| 65 20 6c 69 62 72 61 72 | 79 2e 20 20 54 68 69 73 |e librar|y. This|
|00000590| 20 69 73 20 61 6c 73 6f | 20 74 72 75 65 20 6f 66 | is also| true of|
|000005a0| 20 49 4f 73 74 6f 6e 65 | 2c 0a 69 6e 20 66 61 63 | IOstone|,.in fac|
|000005b0| 74 20 49 20 69 6e 74 65 | 6e 64 20 74 68 69 73 20 |t I inte|nd this |
|000005c0| 70 72 6f 67 72 61 6d 20 | 61 73 20 61 20 63 6f 6d |program |as a com|
|000005d0| 70 61 6e 69 6f 6e 20 70 | 69 65 63 65 20 74 6f 20 |panion p|iece to |
|000005e0| 49 4f 73 74 6f 6e 65 2e | 20 0a 0a 54 68 69 73 20 |IOstone.| ..This |
|000005f0| 62 65 6e 63 68 6d 61 72 | 6b 20 69 73 20 70 6f 72 |benchmar|k is por|
|00000600| 74 61 62 6c 65 20 61 6e | 64 20 68 61 73 20 62 65 |table an|d has be|
|00000610| 65 6e 20 74 65 73 74 65 | 64 20 6f 6e 20 74 68 65 |en teste|d on the|
|00000620| 73 65 20 6f 70 65 72 61 | 74 69 6e 67 20 73 79 73 |se opera|ting sys|
|00000630| 74 65 6d 73 3a 0a 09 0a | 09 56 41 58 2f 56 4d 53 |tems:...|.VAX/VMS|
|00000640| 20 56 35 2e 34 0a 09 55 | 6c 74 72 69 78 20 56 34 | V5.4..U|ltrix V4|
|00000650| 2e 31 0a 09 4d 53 2d 44 | 4f 53 20 56 33 2e 31 0a |.1..MS-D|OS V3.1.|
|00000660| 09 4f 53 46 2f 31 0a 0a | 49 4f 5a 4f 4e 45 2e 43 |.OSF/1..|IOZONE.C|
|00000670| 20 69 73 20 66 72 65 65 | 20 61 6e 64 20 69 6e 20 | is free| and in |
|00000680| 74 68 65 20 70 75 62 6c | 69 63 20 64 6f 6d 61 69 |the publ|ic domai|
|00000690| 6e 2e 20 20 49 20 77 6f | 75 6c 64 20 61 70 70 72 |n. I wo|uld appr|
|000006a0| 65 63 69 61 74 65 20 79 | 6f 75 72 0a 63 6f 6d 6d |eciate y|our.comm|
|000006b0| 65 6e 74 20 61 6e 64 20 | 74 65 73 74 20 72 65 73 |ent and |test res|
|000006c0| 75 6c 74 73 2e 0a 0a 42 | 69 6c 6c 20 4e 6f 72 63 |ults...B|ill Norc|
|000006d0| 6f 74 74 09 28 42 69 6c | 6c 2e 4e 6f 72 63 6f 74 |ott.(Bil|l.Norcot|
|000006e0| 74 2e 6e 75 6f 2e 6d 74 | 73 2e 64 65 63 2e 63 6f |t.nuo.mt|s.dec.co|
|000006f0| 6d 29 0a 0a 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |m)..----|--------|
|00000700| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000710| 2d 2d 20 20 20 43 55 54 | 20 48 45 52 45 20 2d 2d |-- CUT| HERE --|
|00000720| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000730| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 20 0a 23 21 20 |--------|--- .#! |
|00000740| 2f 62 69 6e 2f 73 68 0a | 23 20 54 68 69 73 20 69 |/bin/sh.|# This i|
|00000750| 73 20 61 20 73 68 65 6c | 6c 20 61 72 63 68 69 76 |s a shel|l archiv|
|00000760| 65 2e 20 20 52 65 6d 6f | 76 65 20 61 6e 79 74 68 |e. Remo|ve anyth|
|00000770| 69 6e 67 20 62 65 66 6f | 72 65 20 74 68 69 73 20 |ing befo|re this |
|00000780| 6c 69 6e 65 2c 20 74 68 | 65 6e 20 66 65 65 64 20 |line, th|en feed |
|00000790| 69 74 0a 23 20 69 6e 74 | 6f 20 61 20 73 68 65 6c |it.# int|o a shel|
|000007a0| 6c 20 76 69 61 20 22 73 | 68 20 66 69 6c 65 22 20 |l via "s|h file" |
|000007b0| 6f 72 20 73 69 6d 69 6c | 61 72 2e 20 20 54 6f 20 |or simil|ar. To |
|000007c0| 6f 76 65 72 77 72 69 74 | 65 20 65 78 69 73 74 69 |overwrit|e existi|
|000007d0| 6e 67 20 66 69 6c 65 73 | 2c 0a 23 20 74 79 70 65 |ng files|,.# type|
|000007e0| 20 22 73 68 20 66 69 6c | 65 20 2d 63 22 2e 0a 23 | "sh fil|e -c"..#|
|000007f0| 20 54 68 65 20 74 6f 6f | 6c 20 74 68 61 74 20 67 | The too|l that g|
|00000800| 65 6e 65 72 61 74 65 64 | 20 74 68 69 73 20 61 70 |enerated| this ap|
|00000810| 70 65 61 72 65 64 20 69 | 6e 20 74 68 65 20 63 6f |peared i|n the co|
|00000820| 6d 70 2e 73 6f 75 72 63 | 65 73 2e 75 6e 69 78 20 |mp.sourc|es.unix |
|00000830| 6e 65 77 73 67 72 6f 75 | 70 3b 0a 23 20 73 65 6e |newsgrou|p;.# sen|
|00000840| 64 20 6d 61 69 6c 20 74 | 6f 20 63 6f 6d 70 2d 73 |d mail t|o comp-s|
|00000850| 6f 75 72 63 65 73 2d 75 | 6e 69 78 40 75 75 6e 65 |ources-u|nix@uune|
|00000860| 74 2e 75 75 2e 6e 65 74 | 20 69 66 20 79 6f 75 20 |t.uu.net| if you |
|00000870| 77 61 6e 74 20 74 68 61 | 74 20 74 6f 6f 6c 2e 0a |want tha|t tool..|
|00000880| 23 20 43 6f 6e 74 65 6e | 74 73 3a 20 20 69 6f 7a |# Conten|ts: ioz|
|00000890| 6f 6e 65 2e 63 0a 23 20 | 57 72 61 70 70 65 64 20 |one.c.# |Wrapped |
|000008a0| 62 79 20 6b 65 6e 74 40 | 73 70 61 72 6b 79 20 6f |by kent@|sparky o|
|000008b0| 6e 20 46 72 69 20 4d 61 | 72 20 32 32 20 31 35 3a |n Fri Ma|r 22 15:|
|000008c0| 32 35 3a 30 33 20 31 39 | 39 31 0a 50 41 54 48 3d |25:03 19|91.PATH=|
|000008d0| 2f 62 69 6e 3a 2f 75 73 | 72 2f 62 69 6e 3a 2f 75 |/bin:/us|r/bin:/u|
|000008e0| 73 72 2f 75 63 62 20 3b | 20 65 78 70 6f 72 74 20 |sr/ucb ;| export |
|000008f0| 50 41 54 48 0a 65 63 68 | 6f 20 49 66 20 74 68 69 |PATH.ech|o If thi|
|00000900| 73 20 61 72 63 68 69 76 | 65 20 69 73 20 63 6f 6d |s archiv|e is com|
|00000910| 70 6c 65 74 65 2c 20 79 | 6f 75 20 77 69 6c 6c 20 |plete, y|ou will |
|00000920| 73 65 65 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |see the |followin|
|00000930| 67 20 6d 65 73 73 61 67 | 65 3a 0a 65 63 68 6f 20 |g messag|e:.echo |
|00000940| 27 20 20 20 20 20 20 20 | 20 20 20 22 73 68 61 72 |' | "shar|
|00000950| 3a 20 45 6e 64 20 6f 66 | 20 61 72 63 68 69 76 65 |: End of| archive|
|00000960| 2e 22 27 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |."'.if t|est -f '|
|00000970| 69 6f 7a 6f 6e 65 2e 63 | 27 20 2d 61 20 22 24 7b |iozone.c|' -a "${|
|00000980| 31 7d 22 20 21 3d 20 22 | 2d 63 22 20 3b 20 74 68 |1}" != "|-c" ; th|
|00000990| 65 6e 20 0a 20 20 65 63 | 68 6f 20 73 68 61 72 3a |en . ec|ho shar:|
|000009a0| 20 57 69 6c 6c 20 6e 6f | 74 20 63 6c 6f 62 62 65 | Will no|t clobbe|
|000009b0| 72 20 65 78 69 73 74 69 | 6e 67 20 66 69 6c 65 20 |r existi|ng file |
|000009c0| 5c 22 27 69 6f 7a 6f 6e | 65 2e 63 27 5c 22 0a 65 |\"'iozon|e.c'\".e|
|000009d0| 6c 73 65 0a 20 20 65 63 | 68 6f 20 73 68 61 72 3a |lse. ec|ho shar:|
|000009e0| 20 45 78 74 72 61 63 74 | 69 6e 67 20 5c 22 27 69 | Extract|ing \"'i|
|000009f0| 6f 7a 6f 6e 65 2e 63 27 | 5c 22 20 5c 28 37 37 32 |ozone.c'|\" \(772|
|00000a00| 33 20 63 68 61 72 61 63 | 74 65 72 73 5c 29 0a 20 |3 charac|ters\). |
|00000a10| 20 73 65 64 20 22 73 2f | 5e 58 2f 2f 22 20 3e 27 | sed "s/|^X//" >'|
|00000a20| 69 6f 7a 6f 6e 65 2e 63 | 27 20 3c 3c 27 45 4e 44 |iozone.c|' <<'END|
|00000a30| 5f 4f 46 5f 46 49 4c 45 | 27 0a 58 2f 2a 0a 58 2a |_OF_FILE|'.X/*.X*|
|00000a40| 09 22 49 4f 20 5a 6f 6e | 65 22 20 42 65 6e 63 68 |."IO Zon|e" Bench|
|00000a50| 6d 61 72 6b 20 50 72 6f | 67 72 61 6d 0a 58 2a 0a |mark Pro|gram.X*.|
|00000a60| 58 2a 09 41 75 74 68 6f | 72 3a 09 42 69 6c 6c 20 |X*.Autho|r:.Bill |
|00000a70| 4e 6f 72 63 6f 74 74 20 | 28 42 69 6c 6c 2e 4e 6f |Norcott |(Bill.No|
|00000a80| 72 63 6f 74 74 40 6e 75 | 6f 2e 6d 74 73 2e 64 65 |rcott@nu|o.mts.de|
|00000a90| 63 2e 63 6f 6d 29 0a 58 | 2a 09 09 34 20 44 75 6e |c.com).X|*..4 Dun|
|00000aa0| 6c 61 70 20 44 72 69 76 | 65 0a 58 2a 09 09 4e 61 |lap Driv|e.X*..Na|
|00000ab0| 73 68 75 61 2c 20 4e 48 | 20 20 30 33 30 36 30 0a |shua, NH| 03060.|
|00000ac0| 58 2a 0a 58 2a 20 20 22 | 43 6f 70 79 72 69 67 68 |X*.X* "|Copyrigh|
|00000ad0| 74 20 31 39 39 31 2c 20 | 20 20 57 69 6c 6c 69 61 |t 1991, | Willia|
|00000ae0| 6d 20 44 2e 20 4e 6f 72 | 63 6f 74 74 0a 58 2a 20 |m D. Nor|cott.X* |
|00000af0| 20 54 68 69 73 20 69 73 | 20 66 72 65 65 20 73 6f | This is| free so|
|00000b00| 66 74 77 61 72 65 2e 20 | 20 4c 69 63 65 6e 73 65 |ftware. | License|
|00000b10| 20 74 6f 20 66 72 65 65 | 6c 79 20 75 73 65 20 61 | to free|ly use a|
|00000b20| 6e 64 20 64 69 73 74 72 | 69 62 75 74 65 20 74 68 |nd distr|ibute th|
|00000b30| 69 73 0a 58 2a 20 20 73 | 6f 66 74 77 61 72 65 20 |is.X* s|oftware |
|00000b40| 69 73 20 68 65 72 65 62 | 79 20 67 72 61 6e 74 65 |is hereb|y grante|
|00000b50| 64 20 62 79 20 74 68 65 | 20 61 75 74 68 6f 72 2c |d by the| author,|
|00000b60| 20 73 75 62 6a 65 63 74 | 20 74 6f 20 74 68 65 20 | subject| to the |
|00000b70| 63 6f 6e 64 69 74 69 6f | 6e 0a 58 2a 20 20 74 68 |conditio|n.X* th|
|00000b80| 61 74 20 74 68 69 73 20 | 63 6f 70 79 72 69 67 68 |at this |copyrigh|
|00000b90| 74 20 6e 6f 74 69 63 65 | 20 72 65 6d 61 69 6e 73 |t notice| remains|
|00000ba0| 20 69 6e 74 61 63 74 2e | 22 0a 58 2a 0a 58 2a 20 | intact.|".X*.X* |
|00000bb0| 22 54 68 69 73 20 74 65 | 73 74 20 77 72 69 74 65 |"This te|st write|
|00000bc0| 73 20 61 20 34 20 4d 45 | 47 41 42 59 54 45 20 73 |s a 4 ME|GABYTE s|
|00000bd0| 65 71 75 65 6e 74 69 61 | 6c 20 66 69 6c 65 20 69 |equentia|l file i|
|00000be0| 6e 20 35 31 32 20 62 79 | 74 65 20 63 68 75 6e 6b |n 512 by|te chunk|
|00000bf0| 73 2c 20 74 68 65 6e 0a | 58 2a 20 72 65 77 69 6e |s, then.|X* rewin|
|00000c00| 64 73 20 69 74 20 20 61 | 6e 64 20 72 65 61 64 73 |ds it a|nd reads|
|00000c10| 20 69 74 20 62 61 63 6b | 2e 20 20 5b 54 68 65 20 | it back|. [The |
|00000c20| 73 69 7a 65 20 6f 66 20 | 74 68 65 20 66 69 6c 65 |size of |the file|
|00000c30| 20 73 68 6f 75 6c 64 20 | 62 65 0a 58 2a 20 62 69 | should |be.X* bi|
|00000c40| 67 20 65 6e 6f 75 67 68 | 20 74 6f 20 66 61 63 74 |g enough| to fact|
|00000c50| 6f 72 20 6f 75 74 20 74 | 68 65 20 65 66 66 65 63 |or out t|he effec|
|00000c60| 74 20 6f 66 20 61 6e 79 | 20 64 69 73 6b 20 63 61 |t of any| disk ca|
|00000c70| 63 68 65 2e 5d 0a 58 2a | 20 20 20 20 20 20 20 0a |che.].X*| .|
|00000c80| 58 2a 20 54 68 65 20 66 | 69 6c 65 20 69 73 20 77 |X* The f|ile is w|
|00000c90| 72 69 74 74 65 6e 20 28 | 66 69 6c 6c 69 6e 67 20 |ritten (|filling |
|00000ca0| 61 6e 79 20 63 61 63 68 | 65 20 62 75 66 66 65 72 |any cach|e buffer|
|00000cb0| 73 29 2c 20 61 6e 64 20 | 74 68 65 6e 20 72 65 61 |s), and |then rea|
|00000cc0| 64 2e 20 20 49 66 20 74 | 68 65 0a 58 2a 20 63 61 |d. If t|he.X* ca|
|00000cd0| 63 68 65 20 69 73 20 3e | 3d 20 34 20 4d 42 2c 20 |che is >|= 4 MB, |
|00000ce0| 74 68 65 6e 20 6d 6f 73 | 74 20 69 66 20 6e 6f 74 |then mos|t if not|
|00000cf0| 20 61 6c 6c 20 74 68 65 | 20 72 65 61 64 73 20 77 | all the| reads w|
|00000d00| 69 6c 6c 20 62 65 20 73 | 61 74 69 73 66 69 65 64 |ill be s|atisfied|
|00000d10| 20 66 72 6f 6d 0a 58 2a | 20 74 68 65 20 63 61 63 | from.X*| the cac|
|00000d20| 68 65 2e 20 20 48 6f 77 | 65 76 65 72 2c 20 69 66 |he. How|ever, if|
|00000d30| 20 69 74 20 69 73 20 6c | 65 73 73 20 74 68 61 6e | it is l|ess than|
|00000d40| 20 6f 72 20 65 71 75 61 | 6c 20 74 6f 20 32 20 4d | or equa|l to 2 M|
|00000d50| 42 2c 20 74 68 65 6e 20 | 4e 4f 4e 45 20 6f 66 0a |B, then |NONE of.|
|00000d60| 58 2a 20 74 68 65 20 72 | 65 61 64 73 20 77 69 6c |X* the r|eads wil|
|00000d70| 6c 20 62 65 20 73 61 74 | 69 73 66 69 65 64 20 66 |l be sat|isfied f|
|00000d80| 72 6f 6d 20 74 68 65 20 | 63 61 63 68 65 2e 20 20 |rom the |cache. |
|00000d90| 54 68 69 73 20 69 73 20 | 62 65 63 61 73 65 20 61 |This is |becase a|
|00000da0| 66 74 65 72 20 74 68 65 | 20 0a 58 2a 20 66 69 6c |fter the| .X* fil|
|00000db0| 65 20 69 73 20 77 72 69 | 74 74 65 6e 2c 20 61 20 |e is wri|tten, a |
|00000dc0| 32 20 4d 42 20 63 61 63 | 68 65 20 77 69 6c 6c 20 |2 MB cac|he will |
|00000dd0| 63 6f 6e 74 61 69 6e 20 | 74 68 65 20 75 70 70 65 |contain |the uppe|
|00000de0| 72 20 32 20 4d 42 20 6f | 66 20 74 68 65 20 74 65 |r 2 MB o|f the te|
|00000df0| 73 74 0a 58 2a 20 66 69 | 6c 65 2c 20 62 75 74 20 |st.X* fi|le, but |
|00000e00| 77 65 20 77 69 6c 6c 20 | 73 74 61 72 74 20 72 65 |we will |start re|
|00000e10| 61 64 69 6e 67 20 66 72 | 6f 6d 20 74 68 65 20 62 |ading fr|om the b|
|00000e20| 65 67 69 6e 6e 69 6e 67 | 20 6f 66 20 74 68 65 20 |eginning| of the |
|00000e30| 66 69 6c 65 20 28 64 61 | 74 61 0a 58 2a 20 77 68 |file (da|ta.X* wh|
|00000e40| 69 63 68 20 69 73 20 6e | 6f 20 6c 6f 6e 67 65 72 |ich is n|o longer|
|00000e50| 20 69 6e 20 74 68 65 20 | 63 61 63 68 65 29 0a 58 | in the |cache).X|
|00000e60| 2a 20 49 6e 20 6f 72 64 | 65 72 20 66 6f 72 20 74 |* In ord|er for t|
|00000e70| 68 69 73 20 74 6f 20 62 | 65 20 61 20 66 61 69 72 |his to b|e a fair|
|00000e80| 20 74 65 73 74 2c 20 74 | 68 65 20 6c 65 6e 67 74 | test, t|he lengt|
|00000e90| 68 20 6f 66 20 74 68 65 | 20 74 65 73 74 20 66 69 |h of the| test fi|
|00000ea0| 6c 65 20 6d 75 73 74 0a | 58 2a 20 62 65 20 41 54 |le must.|X* be AT|
|00000eb0| 20 4c 45 41 53 54 20 32 | 58 20 74 68 65 20 61 6d | LEAST 2|X the am|
|00000ec0| 6f 75 6e 74 20 6f 66 20 | 64 69 73 6b 20 63 61 63 |ount of |disk cac|
|00000ed0| 68 65 20 6d 65 6d 6f 72 | 79 20 66 6f 72 20 79 6f |he memor|y for yo|
|00000ee0| 75 72 20 73 79 73 74 65 | 6d 2e 20 20 49 66 0a 58 |ur syste|m. If.X|
|00000ef0| 2a 20 6e 6f 74 2c 20 79 | 6f 75 20 61 72 65 20 72 |* not, y|ou are r|
|00000f00| 65 61 6c 6c 79 20 74 65 | 73 74 69 6e 67 20 74 68 |eally te|sting th|
|00000f10| 65 20 73 70 65 65 64 20 | 61 74 20 77 68 69 63 68 |e speed |at which|
|00000f20| 20 79 6f 75 72 20 43 50 | 55 20 63 61 6e 20 72 65 | your CP|U can re|
|00000f30| 61 64 20 62 6c 6f 63 6b | 73 0a 58 2a 20 6f 75 74 |ad block|s.X* out|
|00000f40| 20 6f 66 20 74 68 65 20 | 63 61 63 68 65 20 28 6e | of the |cache (n|
|00000f50| 6f 74 20 61 20 66 61 69 | 72 20 74 65 73 74 29 0a |ot a fai|r test).|
|00000f60| 58 2a 20 20 20 20 20 20 | 20 0a 58 2a 20 49 4f 5a |X* | .X* IOZ|
|00000f70| 4f 4e 45 20 64 6f 65 73 | 20 4e 4f 54 20 74 65 73 |ONE does| NOT tes|
|00000f80| 74 20 74 68 65 20 72 61 | 77 20 49 2f 4f 20 73 70 |t the ra|w I/O sp|
|00000f90| 65 65 64 20 6f 66 20 79 | 6f 75 72 20 64 69 73 6b |eed of y|our disk|
|00000fa0| 20 6f 72 20 73 79 73 74 | 65 6d 2e 20 20 49 74 0a | or syst|em. It.|
|00000fb0| 58 2a 20 74 65 73 74 73 | 20 74 68 65 20 73 70 65 |X* tests| the spe|
|00000fc0| 65 64 20 6f 66 20 73 65 | 71 75 65 6e 74 69 61 6c |ed of se|quential|
|00000fd0| 20 49 2f 4f 20 74 6f 20 | 61 63 74 75 61 6c 20 66 | I/O to |actual f|
|00000fe0| 69 6c 65 73 2e 20 20 54 | 68 65 72 65 66 6f 72 65 |iles. T|herefore|
|00000ff0| 2c 20 74 68 69 73 0a 58 | 2a 20 6d 65 61 73 75 72 |, this.X|* measur|
|00001000| 65 6d 65 6e 74 20 66 61 | 63 74 6f 72 73 20 69 6e |ement fa|ctors in|
|00001010| 20 74 68 65 20 65 66 66 | 69 63 69 65 6e 63 79 20 | the eff|iciency |
|00001020| 6f 66 20 79 6f 75 20 6d | 61 63 68 69 6e 65 73 20 |of you m|achines |
|00001030| 66 69 6c 65 20 73 79 73 | 74 65 6d 2c 0a 58 2a 20 |file sys|tem,.X* |
|00001040| 6f 70 65 72 61 74 69 6e | 67 20 73 79 73 74 65 6d |operatin|g system|
|00001050| 2c 20 43 20 63 6f 6d 70 | 69 6c 65 72 2c 20 61 6e |, C comp|iler, an|
|00001060| 64 20 43 20 72 75 6e 74 | 69 6d 65 20 6c 69 62 72 |d C runt|ime libr|
|00001070| 61 72 79 2e 20 20 49 74 | 20 70 72 6f 64 75 63 65 |ary. It| produce|
|00001080| 73 20 61 20 0a 58 2a 20 | 6d 65 61 73 75 72 65 6d |s a .X* |measurem|
|00001090| 65 6e 74 20 77 68 69 63 | 68 20 69 73 20 74 68 65 |ent whic|h is the|
|000010a0| 20 6e 75 6d 62 65 72 20 | 6f 66 20 62 79 74 65 73 | number |of bytes|
|000010b0| 20 70 65 72 20 73 65 63 | 6f 6e 64 20 74 68 61 74 | per sec|ond that|
|000010c0| 20 79 6f 75 72 20 73 79 | 73 74 65 6d 0a 58 2a 20 | your sy|stem.X* |
|000010d0| 63 61 6e 20 72 65 61 64 | 20 6f 72 20 77 72 69 74 |can read| or writ|
|000010e0| 65 20 74 6f 20 61 20 66 | 69 6c 65 2e 20 20 46 6f |e to a f|ile. Fo|
|000010f0| 72 20 55 4e 49 58 20 73 | 79 73 74 65 6d 73 20 49 |r UNIX s|ystems I|
|00001100| 20 63 61 6c 6c 20 66 73 | 79 6e 63 28 29 20 74 6f | call fs|ync() to|
|00001110| 20 66 6f 72 63 65 0a 58 | 2a 20 74 68 65 20 77 72 | force.X|* the wr|
|00001120| 69 74 65 73 20 74 6f 20 | 64 69 73 6b 2e 20 20 54 |ites to |disk. T|
|00001130| 68 69 73 20 67 69 76 65 | 73 20 61 20 74 65 73 74 |his give|s a test|
|00001140| 20 6f 66 20 74 68 65 20 | 74 69 6d 65 20 69 74 20 | of the |time it |
|00001150| 74 61 6b 65 73 20 74 6f | 0a 58 2a 20 61 63 74 75 |takes to|.X* actu|
|00001160| 61 6c 6c 79 20 67 65 74 | 20 64 61 74 61 20 6f 6e |ally get| data on|
|00001170| 74 6f 20 74 68 65 20 64 | 69 73 6b 2e 0a 58 2a 20 |to the d|isk..X* |
|00001180| 20 20 20 20 20 20 0a 58 | 2a 20 54 68 69 73 20 70 | .X|* This p|
|00001190| 72 6f 67 72 61 6d 20 68 | 61 73 20 62 65 65 6e 20 |rogram h|as been |
|000011a0| 70 6f 72 74 65 64 20 61 | 6e 64 20 74 65 73 74 65 |ported a|nd teste|
|000011b0| 64 20 6f 6e 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |d on the| followi|
|000011c0| 6e 67 20 63 6f 6d 70 75 | 74 65 72 0a 58 2a 20 6f |ng compu|ter.X* o|
|000011d0| 70 65 72 61 74 69 6e 67 | 20 73 79 73 74 65 6d 73 |perating| systems|
|000011e0| 3a 0a 58 2a 09 56 41 58 | 2f 56 4d 53 20 56 35 2e |:.X*.VAX|/VMS V5.|
|000011f0| 34 2c 20 55 6c 74 72 69 | 78 20 56 34 2e 31 2c 20 |4, Ultri|x V4.1, |
|00001200| 4f 53 46 2f 31 20 61 6e | 64 20 4d 53 2d 44 4f 53 |OSF/1 an|d MS-DOS|
|00001210| 20 33 2e 33 22 0a 58 2a | 20 20 20 20 20 20 20 0a | 3.3".X*| .|
|00001220| 58 2a 20 2d 2d 2d 20 4d | 4f 44 49 46 49 43 41 54 |X* --- M|ODIFICAT|
|00001230| 49 4f 4e 20 48 49 53 54 | 4f 52 59 3a 0a 58 2a 0a |ION HIST|ORY:.X*.|
|00001240| 58 2a 20 20 20 33 2f 37 | 2f 39 31 20 57 69 6c 6c |X* 3/7|/91 Will|
|00001250| 69 61 6d 20 44 2e 20 4e | 6f 72 63 6f 74 74 20 28 |iam D. N|orcott (|
|00001260| 42 69 6c 6c 2e 4e 6f 72 | 63 6f 74 74 40 6e 75 6f |Bill.Nor|cott@nuo|
|00001270| 2e 6d 74 73 2e 64 65 63 | 2e 63 6f 6d 29 0a 58 2a |.mts.dec|.com).X*|
|00001280| 09 20 20 20 20 63 72 65 | 61 74 65 64 0a 58 2a 20 |. cre|ated.X* |
|00001290| 20 20 33 2f 32 32 2f 39 | 31 20 42 69 6c 6c 20 4e | 3/22/9|1 Bill N|
|000012a0| 6f 72 63 6f 74 74 20 20 | 20 20 74 65 73 74 65 64 |orcott | tested|
|000012b0| 20 6f 6e 20 4f 53 46 2f | 31 20 2e 2e 2e 20 69 74 | on OSF/|1 ... it|
|000012c0| 20 77 6f 72 6b 73 0a 58 | 2a 0a 58 2a 2f 0a 58 23 | works.X|*.X*/.X#|
|000012d0| 69 66 64 65 66 09 5f 5f | 4d 53 44 4f 53 5f 5f 09 |ifdef.__|MSDOS__.|
|000012e0| 09 2f 2a 20 54 75 72 62 | 6f 20 43 20 64 65 66 69 |./* Turb|o C defi|
|000012f0| 6e 65 20 74 68 69 73 20 | 77 61 79 20 66 6f 72 20 |ne this |way for |
|00001300| 50 43 73 2e 2e 2e 20 2a | 2f 0a 58 23 64 65 66 69 |PCs... *|/.X#defi|
|00001310| 6e 65 09 4d 53 44 4f 53 | 09 09 09 2f 2a 20 4d 69 |ne.MSDOS|.../* Mi|
|00001320| 63 72 6f 73 6f 66 74 20 | 43 20 64 65 66 69 6e 65 |crosoft |C define|
|00001330| 73 20 74 68 69 73 20 2a | 2f 0a 58 23 65 6e 64 69 |s this *|/.X#endi|
|00001340| 66 0a 58 2f 2a 20 56 4d | 53 20 61 6e 64 20 4d 53 |f.X/* VM|S and MS|
|00001350| 2d 44 4f 53 20 62 6f 74 | 68 20 68 61 76 65 20 41 |-DOS bot|h have A|
|00001360| 4e 53 49 20 43 20 63 6f | 6d 70 69 6c 65 72 73 20 |NSI C co|mpilers |
|00001370| 61 6e 64 20 75 73 65 20 | 72 61 6e 64 28 29 2f 73 |and use |rand()/s|
|00001380| 72 61 6e 64 28 29 20 2a | 2f 0a 58 23 69 66 64 65 |rand() *|/.X#ifde|
|00001390| 66 09 56 4d 53 5f 50 4f | 53 49 58 0a 58 23 75 6e |f.VMS_PO|SIX.X#un|
|000013a0| 64 65 66 20 20 20 56 4d | 53 0a 58 23 64 65 66 69 |def VM|S.X#defi|
|000013b0| 6e 65 09 41 4e 53 49 5f | 52 41 4e 44 4f 4d 09 31 |ne.ANSI_|RANDOM.1|
|000013c0| 0a 58 23 65 6e 64 69 66 | 0a 58 23 69 66 64 65 66 |.X#endif|.X#ifdef|
|000013d0| 09 4d 53 44 4f 53 0a 58 | 23 64 65 66 69 6e 65 09 |.MSDOS.X|#define.|
|000013e0| 41 4e 53 49 5f 52 41 4e | 44 4f 4d 09 31 0a 58 23 |ANSI_RAN|DOM.1.X#|
|000013f0| 65 6e 64 69 66 0a 58 0a | 58 23 69 66 20 64 65 66 |endif.X.|X#if def|
|00001400| 69 6e 65 64 28 56 4d 53 | 29 0a 58 23 64 65 66 69 |ined(VMS|).X#defi|
|00001410| 6e 65 09 41 4e 53 49 5f | 52 41 4e 44 4f 4d 09 31 |ne.ANSI_|RANDOM.1|
|00001420| 0a 58 23 69 6e 63 6c 75 | 64 65 20 20 20 20 3c 6d |.X#inclu|de <m|
|00001430| 61 74 68 2e 68 3e 0a 58 | 23 69 6e 63 6c 75 64 65 |ath.h>.X|#include|
|00001440| 20 20 20 20 3c 75 6e 69 | 78 69 6f 2e 68 3e 0a 58 | <uni|xio.h>.X|
|00001450| 23 69 6e 63 6c 75 64 65 | 20 20 20 20 3c 73 73 64 |#include| <ssd|
|00001460| 65 66 2e 68 3e 0a 58 23 | 69 6e 63 6c 75 64 65 20 |ef.h>.X#|include |
|00001470| 20 20 20 3c 66 69 6c 65 | 2e 68 3e 0a 58 0a 58 23 | <file|.h>.X.X#|
|00001480| 65 6c 69 66 20 64 65 66 | 69 6e 65 64 28 4d 53 44 |elif def|ined(MSD|
|00001490| 4f 53 29 0a 58 23 69 6e | 63 6c 75 64 65 20 3c 66 |OS).X#in|clude <f|
|000014a0| 63 6e 74 6c 2e 68 3e 0a | 58 23 65 6c 69 66 20 64 |cntl.h>.|X#elif d|
|000014b0| 65 66 69 6e 65 64 28 75 | 6e 69 78 29 0a 58 23 69 |efined(u|nix).X#i|
|000014c0| 6e 63 6c 75 64 65 20 3c | 73 79 73 2f 66 69 6c 65 |nclude <|sys/file|
|000014d0| 2e 68 3e 0a 58 23 69 6e | 63 6c 75 64 65 20 3c 6c |.h>.X#in|clude <l|
|000014e0| 69 6d 69 74 73 2e 68 3e | 0a 58 23 65 6e 64 69 66 |imits.h>|.X#endif|
|000014f0| 0a 58 0a 58 23 64 65 66 | 69 6e 65 20 4d 45 47 41 |.X.X#def|ine MEGA|
|00001500| 42 59 54 45 53 20 31 09 | 09 09 2f 2a 20 6e 75 6d |BYTES 1.|../* num|
|00001510| 62 65 72 20 6f 66 20 6d | 65 67 61 62 79 74 65 73 |ber of m|egabytes|
|00001520| 20 69 6e 20 66 69 6c 65 | 20 2a 2f 0a 58 23 64 65 | in file| */.X#de|
|00001530| 66 69 6e 65 20 52 45 43 | 4c 45 4e 20 35 31 32 09 |fine REC|LEN 512.|
|00001540| 09 09 2f 2a 20 6e 75 6d | 62 65 72 20 6f 66 20 62 |../* num|ber of b|
|00001550| 79 74 65 73 20 69 6e 20 | 61 20 72 65 63 6f 72 64 |ytes in |a record|
|00001560| 20 2a 2f 0a 58 23 64 65 | 66 69 6e 65 20 46 49 4c | */.X#de|fine FIL|
|00001570| 45 53 49 5a 45 20 28 4d | 45 47 41 42 59 54 45 53 |ESIZE (M|EGABYTES|
|00001580| 2a 31 30 32 34 2a 31 30 | 32 34 29 09 2f 2a 73 69 |*1024*10|24)./*si|
|00001590| 7a 65 20 6f 66 20 66 69 | 6c 65 20 69 6e 20 62 79 |ze of fi|le in by|
|000015a0| 74 65 73 2a 2f 0a 58 23 | 64 65 66 69 6e 65 20 4e |tes*/.X#|define N|
|000015b0| 55 4d 52 45 43 53 20 46 | 49 4c 45 53 49 5a 45 2f |UMRECS F|ILESIZE/|
|000015c0| 52 45 43 4c 45 4e 09 09 | 2f 2a 20 6e 75 6d 62 65 |RECLEN..|/* numbe|
|000015d0| 72 20 6f 66 20 72 65 63 | 6f 72 64 73 20 2a 2f 0a |r of rec|ords */.|
|000015e0| 58 23 64 65 66 69 6e 65 | 20 4d 41 58 42 55 46 46 |X#define| MAXBUFF|
|000015f0| 45 52 53 49 5a 45 20 31 | 36 2a 31 30 32 34 09 09 |ERSIZE 1|6*1024..|
|00001600| 2f 2a 6d 61 78 69 6d 75 | 6d 20 62 75 66 66 65 72 |/*maximu|m buffer|
|00001610| 20 73 69 7a 65 2a 2f 0a | 58 23 64 65 66 69 6e 65 | size*/.|X#define|
|00001620| 20 54 4f 4f 46 41 53 54 | 20 31 30 0a 58 23 64 65 | TOOFAST| 10.X#de|
|00001630| 66 69 6e 65 20 55 53 41 | 47 45 20 20 22 5c 74 55 |fine USA|GE "\tU|
|00001640| 73 61 67 65 3a 5c 74 69 | 6f 7a 6f 6e 65 20 5b 6d |sage:\ti|ozone [m|
|00001650| 65 67 61 62 79 74 65 73 | 5d 20 5b 72 65 63 6f 72 |egabytes|] [recor|
|00001660| 64 5f 6c 65 6e 67 74 68 | 5d 20 5b 5b 70 61 74 68 |d_length|] [[path|
|00001670| 5d 66 69 6c 65 6e 61 6d | 65 5d 5c 6e 5c 6e 22 0a |]filenam|e]\n\n".|
|00001680| 58 23 64 65 66 69 6e 65 | 20 54 48 49 53 56 45 52 |X#define| THISVER|
|00001690| 53 49 4f 4e 20 22 56 31 | 2e 30 31 22 0a 58 0a 58 |SION "V1|.01".X.X|
|000016a0| 2f 2a 20 44 65 66 69 6e | 65 20 6f 6e 6c 79 20 6f |/* Defin|e only o|
|000016b0| 6e 65 20 6f 66 20 74 68 | 65 20 66 6f 6c 6c 6f 77 |ne of th|e follow|
|000016c0| 69 6e 67 20 74 77 6f 2e | 2a 2f 0a 58 2f 2a 23 64 |ing two.|*/.X/*#d|
|000016d0| 65 66 69 6e 65 20 4e 4f | 54 49 4d 45 09 09 64 65 |efine NO|TIME..de|
|000016e0| 66 69 6e 65 20 69 66 20 | 6e 6f 20 74 69 6d 65 20 |fine if |no time |
|000016f0| 66 75 6e 63 74 69 6f 6e | 20 69 6e 20 6c 69 62 72 |function| in libr|
|00001700| 61 72 79 2a 2f 0a 58 23 | 64 65 66 69 6e 65 20 54 |ary*/.X#|define T|
|00001710| 49 4d 45 09 09 09 09 2f | 2a 55 73 65 20 74 69 6d |IME..../|*Use tim|
|00001720| 65 28 32 29 66 75 6e 63 | 74 69 6f 6e 2a 2f 0a 58 |e(2)func|tion*/.X|
|00001730| 0a 58 23 64 65 66 69 6e | 65 20 4d 41 58 4e 41 4d |.X#defin|e MAXNAM|
|00001740| 45 53 49 5a 45 20 31 30 | 30 30 20 20 20 20 20 20 |ESIZE 10|00 |
|00001750| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 6d 61 78 | | /* max|
|00001760| 20 23 20 6f 66 20 63 68 | 61 72 61 63 74 65 72 73 | # of ch|aracters|
|00001770| 20 69 6e 20 66 69 6c 65 | 6e 61 6d 65 20 2a 2f 0a | in file|name */.|
|00001780| 58 0a 58 6d 61 69 6e 28 | 61 72 67 63 2c 61 72 67 |X.Xmain(|argc,arg|
|00001790| 76 29 20 0a 58 20 20 20 | 20 20 20 69 6e 74 20 61 |v) .X | int a|
|000017a0| 72 67 63 3b 0a 58 20 20 | 20 20 20 63 68 61 72 20 |rgc;.X | char |
|000017b0| 2a 61 72 67 76 5b 5d 3b | 0a 58 7b 0a 58 69 6e 74 |*argv[];|.X{.Xint|
|000017c0| 20 66 64 3b 0a 58 63 68 | 61 72 20 66 69 6c 65 6e | fd;.Xch|ar filen|
|000017d0| 61 6d 65 20 5b 4d 41 58 | 4e 41 4d 45 53 49 5a 45 |ame [MAX|NAMESIZE|
|000017e0| 5d 3b 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a |]; | /*|
|000017f0| 20 6e 61 6d 65 20 6f 66 | 20 74 65 6d 70 6f 72 61 | name of| tempora|
|00001800| 72 79 20 66 69 6c 65 20 | 2a 2f 0a 58 23 69 66 64 |ry file |*/.X#ifd|
|00001810| 65 66 09 56 4d 53 0a 58 | 63 68 61 72 20 2a 64 65 |ef.VMS.X|char *de|
|00001820| 66 61 75 6c 74 5f 66 69 | 6c 65 6e 61 6d 65 3d 22 |fault_fi|lename="|
|00001830| 69 6f 7a 6f 6e 65 5f 74 | 65 6d 70 5f 66 69 6c 65 |iozone_t|emp_file|
|00001840| 22 3b 20 2f 2a 64 65 66 | 61 75 6c 74 20 6e 61 6d |"; /*def|ault nam|
|00001850| 65 20 6f 66 20 74 65 6d | 70 6f 72 61 72 79 20 66 |e of tem|porary f|
|00001860| 69 6c 65 2a 2f 0a 58 23 | 65 6c 73 65 0a 58 23 69 |ile*/.X#|else.X#i|
|00001870| 66 64 65 66 09 4d 53 44 | 4f 53 0a 58 63 68 61 72 |fdef.MSD|OS.Xchar|
|00001880| 20 2a 64 65 66 61 75 6c | 74 5f 66 69 6c 65 6e 61 | *defaul|t_filena|
|00001890| 6d 65 3d 22 69 6f 7a 6f | 6e 65 2e 74 6d 70 22 3b |me="iozo|ne.tmp";|
|000018a0| 20 2f 2a 64 65 66 61 75 | 6c 74 20 6e 61 6d 65 20 | /*defau|lt name |
|000018b0| 6f 66 20 74 65 6d 70 6f | 72 61 72 79 20 66 69 6c |of tempo|rary fil|
|000018c0| 65 2a 2f 0a 58 23 65 6c | 73 65 20 0a 58 63 68 61 |e*/.X#el|se .Xcha|
|000018d0| 72 20 2a 64 65 66 61 75 | 6c 74 5f 66 69 6c 65 6e |r *defau|lt_filen|
|000018e0| 61 6d 65 3d 22 2f 74 6d | 70 2f 69 6f 7a 6f 6e 65 |ame="/tm|p/iozone|
|000018f0| 5f 74 65 6d 70 5f 66 69 | 6c 65 22 3b 20 2f 2a 64 |_temp_fi|le"; /*d|
|00001900| 65 66 61 75 6c 74 20 6e | 61 6d 65 20 6f 66 20 74 |efault n|ame of t|
|00001910| 65 6d 70 6f 72 61 72 79 | 20 66 69 6c 65 2a 2f 0a |emporary| file*/.|
|00001920| 58 23 65 6e 64 69 66 0a | 58 23 65 6e 64 69 66 20 |X#endif.|X#endif |
|00001930| 0a 58 23 69 66 64 65 66 | 09 4d 53 44 4f 53 0a 58 |.X#ifdef|.MSDOS.X|
|00001940| 63 68 61 72 20 2a 62 75 | 66 66 65 72 3b 20 0a 58 |char *bu|ffer; .X|
|00001950| 23 65 6c 73 65 0a 58 63 | 68 61 72 20 62 75 66 66 |#else.Xc|har buff|
|00001960| 65 72 20 5b 4d 41 58 42 | 55 46 46 45 52 53 49 5a |er [MAXB|UFFERSIZ|
|00001970| 45 5d 3b 09 09 2f 2a 61 | 20 74 65 6d 70 6f 72 61 |E];../*a| tempora|
|00001980| 72 79 20 64 61 74 61 20 | 62 75 66 66 65 72 2a 2f |ry data |buffer*/|
|00001990| 0a 58 23 65 6e 64 69 66 | 0a 58 69 6e 74 20 69 2c |.X#endif|.Xint i,|
|000019a0| 20 73 74 61 74 75 73 3b | 0a 58 75 6e 73 69 67 6e | status;|.Xunsign|
|000019b0| 65 64 20 6c 6f 6e 67 20 | 6d 65 67 61 62 79 74 65 |ed long |megabyte|
|000019c0| 73 20 3d 20 4d 45 47 41 | 42 59 54 45 53 2c 20 67 |s = MEGA|BYTES, g|
|000019d0| 6f 6f 64 6d 65 67 73 3b | 0a 58 75 6e 73 69 67 6e |oodmegs;|.Xunsign|
|000019e0| 65 64 20 6c 6f 6e 67 20 | 72 65 63 6c 65 6e 20 3d |ed long |reclen =|
|000019f0| 20 52 45 43 4c 45 4e 2c | 20 67 6f 6f 64 72 65 63 | RECLEN,| goodrec|
|00001a00| 6c 3b 0a 58 75 6e 73 69 | 67 6e 65 64 20 6c 6f 6e |l;.Xunsi|gned lon|
|00001a10| 67 20 66 69 6c 65 73 69 | 7a 65 20 3d 20 46 49 4c |g filesi|ze = FIL|
|00001a20| 45 53 49 5a 45 3b 0a 58 | 75 6e 73 69 67 6e 65 64 |ESIZE;.X|unsigned|
|00001a30| 20 6c 6f 6e 67 20 6e 75 | 6d 72 65 63 73 20 3d 20 | long nu|mrecs = |
|00001a40| 4e 55 4d 52 45 43 53 3b | 0a 58 0a 58 23 69 66 64 |NUMRECS;|.X.X#ifd|
|00001a50| 65 66 20 54 49 4d 45 0a | 58 20 6c 6f 6e 67 20 74 |ef TIME.|X long t|
|00001a60| 69 6d 65 28 29 3b 0a 58 | 20 6c 6f 6e 67 20 73 74 |ime();.X| long st|
|00001a70| 61 72 74 74 69 6d 65 31 | 2c 20 73 74 61 72 74 74 |arttime1|, startt|
|00001a80| 69 6d 65 32 3b 0a 58 20 | 6c 6f 6e 67 20 77 72 69 |ime2;.X |long wri|
|00001a90| 74 65 74 69 6d 65 3b 0a | 58 20 6c 6f 6e 67 20 74 |tetime;.|X long t|
|00001aa0| 6f 74 61 6c 74 69 6d 65 | 3b 0a 58 0a 58 23 65 6e |otaltime|;.X.X#en|
|00001ab0| 64 69 66 0a 58 0a 58 23 | 69 66 64 65 66 20 4d 53 |dif.X.X#|ifdef MS|
|00001ac0| 44 4f 53 0a 58 20 20 62 | 75 66 66 65 72 20 3d 20 |DOS.X b|uffer = |
|00001ad0| 28 63 68 61 72 20 2a 29 | 20 6d 61 6c 6c 6f 63 28 |(char *)| malloc(|
|00001ae0| 4d 41 58 42 55 46 46 45 | 52 53 49 5a 45 29 3b 0a |MAXBUFFE|RSIZE);.|
|00001af0| 58 23 65 6e 64 69 66 0a | 58 0a 58 20 20 70 72 69 |X#endif.|X.X pri|
|00001b00| 6e 74 66 28 22 5c 6e 5c | 74 49 4f 5a 4f 4e 45 3a |ntf("\n\|tIOZONE:|
|00001b10| 20 50 65 72 66 6f 72 6d | 61 6e 63 65 20 54 65 73 | Perform|ance Tes|
|00001b20| 74 20 6f 66 20 53 65 71 | 75 65 6e 74 69 61 6c 20 |t of Seq|uential |
|00001b30| 46 69 6c 65 20 49 2f 4f | 20 20 2d 2d 20 20 25 73 |File I/O| -- %s|
|00001b40| 5c 6e 22 2c 0a 58 20 20 | 09 09 54 48 49 53 56 45 |\n",.X |..THISVE|
|00001b50| 52 53 49 4f 4e 29 3b 0a | 58 20 20 70 72 69 6e 74 |RSION);.|X print|
|00001b60| 66 28 22 5c 74 5c 74 42 | 79 20 42 69 6c 6c 20 4e |f("\t\tB|y Bill N|
|00001b70| 6f 72 63 6f 74 74 5c 6e | 5c 6e 22 29 3b 0a 58 0a |orcott\n|\n");.X.|
|00001b80| 58 20 20 73 74 72 63 70 | 79 28 66 69 6c 65 6e 61 |X strcp|y(filena|
|00001b90| 6d 65 2c 64 65 66 61 75 | 6c 74 5f 66 69 6c 65 6e |me,defau|lt_filen|
|00001ba0| 61 6d 65 29 3b 0a 58 20 | 20 73 77 69 74 63 68 20 |ame);.X | switch |
|00001bb0| 28 61 72 67 63 29 20 7b | 0a 58 20 20 20 20 63 61 |(argc) {|.X ca|
|00001bc0| 73 65 20 31 3a 20 20 20 | 09 2f 2a 20 6e 6f 20 61 |se 1: |./* no a|
|00001bd0| 72 67 73 2c 20 74 61 6b | 65 20 61 6c 6c 20 64 65 |rgs, tak|e all de|
|00001be0| 66 61 75 6c 74 73 20 2a | 2f 0a 58 20 20 09 70 72 |faults *|/.X .pr|
|00001bf0| 69 6e 74 66 28 55 53 41 | 47 45 29 3b 0a 58 09 62 |intf(USA|GE);.X.b|
|00001c00| 72 65 61 6b 3b 0a 58 20 | 20 20 20 63 61 73 65 20 |reak;.X | case |
|00001c10| 32 3a 20 20 20 20 20 2f | 2a 20 3c 6d 65 67 61 62 |2: /|* <megab|
|00001c20| 79 74 65 73 7c 66 69 6c | 65 6e 61 6d 65 3e 20 2a |ytes|fil|ename> *|
|00001c30| 2f 0a 58 09 69 20 3d 20 | 61 74 6f 69 28 61 72 67 |/.X.i = |atoi(arg|
|00001c40| 76 5b 31 5d 29 3b 20 69 | 66 20 28 69 29 20 7b 0a |v[1]); i|f (i) {.|
|00001c50| 58 09 20 20 6d 65 67 61 | 62 79 74 65 73 20 3d 20 |X. mega|bytes = |
|00001c60| 69 3b 0a 58 09 7d 20 65 | 6c 73 65 20 7b 0a 58 09 |i;.X.} e|lse {.X.|
|00001c70| 20 20 73 74 72 63 70 79 | 28 66 69 6c 65 6e 61 6d | strcpy|(filenam|
|00001c80| 65 2c 61 72 67 76 5b 31 | 5d 29 3b 0a 58 20 20 20 |e,argv[1|]);.X |
|00001c90| 20 20 20 20 20 7d 0a 58 | 09 62 72 65 61 6b 3b 0a | }.X|.break;.|
|00001ca0| 58 20 20 20 20 63 61 73 | 65 20 33 3a 20 20 20 20 |X cas|e 3: |
|00001cb0| 20 2f 2a 20 3c 6d 65 67 | 61 62 79 74 65 73 3e 20 | /* <meg|abytes> |
|00001cc0| 3c 72 65 63 6c 65 6e 7c | 66 69 6c 65 6e 61 6d 65 |<reclen||filename|
|00001cd0| 3e 20 2a 2f 0a 58 09 66 | 69 6c 65 73 69 7a 65 20 |> */.X.f|ilesize |
|00001ce0| 3d 20 61 74 6f 69 28 61 | 72 67 76 5b 31 5d 29 3b |= atoi(a|rgv[1]);|
|00001cf0| 0a 58 09 69 20 3d 20 61 | 74 6f 69 28 61 72 67 76 |.X.i = a|toi(argv|
|00001d00| 5b 32 5d 29 3b 20 69 66 | 28 69 29 20 7b 0a 58 09 |[2]); if|(i) {.X.|
|00001d10| 20 20 72 65 63 6c 65 6e | 20 3d 20 28 75 6e 73 69 | reclen| = (unsi|
|00001d20| 67 6e 65 64 29 20 69 3b | 0a 58 09 7d 20 65 6c 73 |gned) i;|.X.} els|
|00001d30| 65 20 7b 0a 58 09 20 20 | 73 74 72 63 70 79 28 66 |e {.X. |strcpy(f|
|00001d40| 69 6c 65 6e 61 6d 65 2c | 61 72 67 76 5b 32 5d 29 |ilename,|argv[2])|
|00001d50| 3b 0a 58 09 7d 0a 58 09 | 62 72 65 61 6b 3b 0a 58 |;.X.}.X.|break;.X|
|00001d60| 20 20 20 20 63 61 73 65 | 20 34 3a 20 20 20 20 20 | case| 4: |
|00001d70| 2f 2a 20 3c 6d 65 67 61 | 62 79 74 65 73 3e 20 3c |/* <mega|bytes> <|
|00001d80| 72 65 63 6c 65 6e 3e 20 | 3c 66 69 6c 65 6e 61 6d |reclen> |<filenam|
|00001d90| 65 3e 20 2a 2f 0a 58 09 | 66 69 6c 65 73 69 7a 65 |e> */.X.|filesize|
|00001da0| 20 3d 20 61 74 6f 69 28 | 61 72 67 76 5b 31 5d 29 | = atoi(|argv[1])|
|00001db0| 3b 0a 58 09 72 65 63 6c | 65 6e 20 3d 20 61 74 6f |;.X.recl|en = ato|
|00001dc0| 69 28 61 72 67 76 5b 32 | 5d 29 3b 0a 58 09 73 74 |i(argv[2|]);.X.st|
|00001dd0| 72 63 70 79 28 66 69 6c | 65 6e 61 6d 65 2c 61 72 |rcpy(fil|ename,ar|
|00001de0| 67 76 5b 33 5d 29 3b 0a | 58 09 62 72 65 61 6b 3b |gv[3]);.|X.break;|
|00001df0| 0a 58 20 20 20 20 64 65 | 66 61 75 6c 74 3a 0a 58 |.X de|fault:.X|
|00001e00| 20 20 20 20 20 20 70 72 | 69 6e 74 66 28 55 53 41 | pr|intf(USA|
|00001e10| 47 45 29 3b 0a 58 20 20 | 20 20 20 20 65 78 69 74 |GE);.X | exit|
|00001e20| 28 31 29 3b 0a 58 0a 58 | 20 20 7d 0a 58 20 20 70 |(1);.X.X| }.X p|
|00001e30| 72 69 6e 74 66 28 22 5c | 74 53 65 6e 64 20 63 6f |rintf("\|tSend co|
|00001e40| 6d 6d 65 6e 74 73 20 74 | 6f 3a 5c 74 42 69 6c 6c |mments t|o:\tBill|
|00001e50| 2e 4e 6f 72 63 6f 74 74 | 40 6e 75 6f 2e 6d 74 73 |.Norcott|@nuo.mts|
|00001e60| 2e 64 65 63 2e 63 6f 6d | 5c 6e 5c 6e 22 29 3b 0a |.dec.com|\n\n");.|
|00001e70| 58 0a 58 20 20 66 69 6c | 65 73 69 7a 65 20 3d 20 |X.X fil|esize = |
|00001e80| 6d 65 67 61 62 79 74 65 | 73 2a 31 30 32 34 2a 31 |megabyte|s*1024*1|
|00001e90| 30 32 34 3b 0a 58 20 20 | 6e 75 6d 72 65 63 73 20 |024;.X |numrecs |
|00001ea0| 3d 20 66 69 6c 65 73 69 | 7a 65 2f 72 65 63 6c 65 |= filesi|ze/recle|
|00001eb0| 6e 3b 0a 58 20 20 69 66 | 20 28 72 65 63 6c 65 6e |n;.X if| (reclen|
|00001ec0| 20 3e 20 20 4d 41 58 42 | 55 46 46 45 52 53 49 5a | > MAXB|UFFERSIZ|
|00001ed0| 45 29 20 7b 0a 58 09 70 | 72 69 6e 74 66 28 22 45 |E) {.X.p|rintf("E|
|00001ee0| 72 72 6f 72 3a 20 4d 61 | 78 69 6d 75 6d 20 72 65 |rror: Ma|ximum re|
|00001ef0| 63 6f 72 64 20 6c 65 6e | 67 74 68 20 69 73 20 25 |cord len|gth is %|
|00001f00| 64 20 62 79 74 65 73 5c | 6e 22 2c 20 4d 41 58 42 |d bytes\|n", MAXB|
|00001f10| 55 46 46 45 52 53 49 5a | 45 29 3b 0a 58 09 7d 0a |UFFERSIZ|E);.X.}.|
|00001f20| 58 20 20 70 72 69 6e 74 | 66 28 22 5c 74 49 4f 5a |X print|f("\tIOZ|
|00001f30| 4f 4e 45 20 77 72 69 74 | 65 73 20 61 20 25 6c 64 |ONE writ|es a %ld|
|00001f40| 20 4d 65 67 61 62 79 74 | 65 20 73 65 71 75 65 6e | Megabyt|e sequen|
|00001f50| 74 69 61 6c 20 66 69 6c | 65 20 63 6f 6e 73 69 73 |tial fil|e consis|
|00001f60| 74 69 6e 67 20 6f 66 5c | 6e 22 2c 0a 58 09 6d 65 |ting of\|n",.X.me|
|00001f70| 67 61 62 79 74 65 73 29 | 3b 0a 58 20 20 70 72 69 |gabytes)|;.X pri|
|00001f80| 6e 74 66 28 22 5c 74 25 | 6c 64 20 72 65 63 6f 72 |ntf("\t%|ld recor|
|00001f90| 64 73 20 77 68 69 63 68 | 20 61 72 65 20 65 61 63 |ds which| are eac|
|00001fa0| 68 20 25 6c 64 20 62 79 | 74 65 73 20 69 6e 20 6c |h %ld by|tes in l|
|00001fb0| 65 6e 67 74 68 2e 5c 6e | 22 2c 0a 58 09 6e 75 6d |ength.\n|",.X.num|
|00001fc0| 72 65 63 73 2c 20 72 65 | 63 6c 65 6e 29 3b 0a 58 |recs, re|clen);.X|
|00001fd0| 20 20 70 72 69 6e 74 66 | 28 22 5c 74 49 74 20 74 | printf|("\tIt t|
|00001fe0| 68 65 6e 20 72 65 61 64 | 73 20 74 68 65 20 66 69 |hen read|s the fi|
|00001ff0| 6c 65 2e 20 20 49 74 20 | 70 72 69 6e 74 73 20 74 |le. It |prints t|
|00002000| 68 65 20 62 79 74 65 73 | 2d 70 65 72 2d 73 65 63 |he bytes|-per-sec|
|00002010| 6f 6e 64 5c 6e 22 29 3b | 0a 58 20 20 70 72 69 6e |ond\n");|.X prin|
|00002020| 74 66 28 22 5c 74 72 61 | 74 65 20 61 74 20 77 68 |tf("\tra|te at wh|
|00002030| 69 63 68 20 74 68 65 20 | 63 6f 6d 70 75 74 65 72 |ich the |computer|
|00002040| 20 63 61 6e 20 72 65 61 | 64 20 61 6e 64 20 77 72 | can rea|d and wr|
|00002050| 69 74 65 20 66 69 6c 65 | 73 2e 5c 6e 5c 6e 22 29 |ite file|s.\n\n")|
|00002060| 3b 0a 58 20 20 70 72 69 | 6e 74 66 28 22 5c 6e 57 |;.X pri|ntf("\nW|
|00002070| 72 69 74 69 6e 67 20 74 | 68 65 20 25 6c 64 20 4d |riting t|he %ld M|
|00002080| 65 67 61 62 79 74 65 20 | 66 69 6c 65 2c 20 27 25 |egabyte |file, '%|
|00002090| 73 27 2e 2e 2e 22 2c 20 | 6d 65 67 61 62 79 74 65 |s'...", |megabyte|
|000020a0| 73 2c 20 66 69 6c 65 6e | 61 6d 65 29 3b 0a 58 0a |s, filen|ame);.X.|
|000020b0| 58 23 69 66 64 65 66 20 | 54 49 4d 45 0a 58 09 73 |X#ifdef |TIME.X.s|
|000020c0| 74 61 72 74 74 69 6d 65 | 31 20 3d 20 74 69 6d 65 |tarttime|1 = time|
|000020d0| 28 30 29 3b 0a 58 23 65 | 6e 64 69 66 0a 58 09 69 |(0);.X#e|ndif.X.i|
|000020e0| 66 28 28 66 64 20 3d 20 | 63 72 65 61 74 28 66 69 |f((fd = |creat(fi|
|000020f0| 6c 65 6e 61 6d 65 2c 20 | 30 36 34 30 29 29 3c 30 |lename, |0640))<0|
|00002100| 29 7b 0a 58 09 09 70 72 | 69 6e 74 66 28 22 43 61 |){.X..pr|intf("Ca|
|00002110| 6e 6e 6f 74 20 63 72 65 | 61 74 65 20 74 65 6d 70 |nnot cre|ate temp|
|00002120| 6f 72 61 72 79 20 66 69 | 6c 65 5c 6e 22 29 3b 0a |orary fi|le\n");.|
|00002130| 58 09 09 65 78 69 74 28 | 31 29 3b 0a 58 09 7d 0a |X..exit(|1);.X.}.|
|00002140| 58 09 66 6f 72 28 69 3d | 30 3b 20 69 3c 6e 75 6d |X.for(i=|0; i<num|
|00002150| 72 65 63 73 3b 20 69 2b | 2b 29 7b 0a 58 09 09 77 |recs; i+|+){.X..w|
|00002160| 72 69 74 65 28 66 64 2c | 20 62 75 66 66 65 72 2c |rite(fd,| buffer,|
|00002170| 20 28 75 6e 73 69 67 6e | 65 64 29 20 72 65 63 6c | (unsign|ed) recl|
|00002180| 65 6e 29 3b 0a 58 09 7d | 0a 58 0a 58 23 69 66 64 |en);.X.}|.X.X#ifd|
|00002190| 65 66 20 54 49 4d 45 0a | 58 09 77 72 69 74 65 74 |ef TIME.|X.writet|
|000021a0| 69 6d 65 20 3d 20 74 69 | 6d 65 28 30 29 20 2d 20 |ime = ti|me(0) - |
|000021b0| 73 74 61 72 74 74 69 6d | 65 31 3b 0a 58 09 70 72 |starttim|e1;.X.pr|
|000021c0| 69 6e 74 66 28 22 25 64 | 20 73 65 63 6f 6e 64 73 |intf("%d| seconds|
|000021d0| 22 2c 20 77 72 69 74 65 | 74 69 6d 65 29 3b 0a 58 |", write|time);.X|
|000021e0| 23 65 6e 64 69 66 0a 58 | 09 63 6c 6f 73 65 28 66 |#endif.X|.close(f|
|000021f0| 64 29 3b 0a 58 23 69 66 | 64 65 66 20 56 4d 53 0a |d);.X#if|def VMS.|
|00002200| 58 09 69 66 28 28 66 64 | 20 3d 20 6f 70 65 6e 28 |X.if((fd| = open(|
|00002210| 66 69 6c 65 6e 61 6d 65 | 2c 20 4f 5f 52 44 4f 4e |filename|, O_RDON|
|00002220| 4c 59 2c 20 30 36 34 30 | 29 29 3c 30 29 7b 0a 58 |LY, 0640|))<0){.X|
|00002230| 09 09 70 72 69 6e 74 66 | 28 22 43 61 6e 6e 6f 74 |..printf|("Cannot|
|00002240| 20 6f 70 65 6e 20 74 65 | 6d 70 6f 72 61 72 79 20 | open te|mporary |
|00002250| 66 69 6c 65 20 66 6f 72 | 20 72 65 61 64 5c 6e 22 |file for| read\n"|
|00002260| 29 3b 0a 58 09 09 65 78 | 69 74 28 31 29 3b 0a 58 |);.X..ex|it(1);.X|
|00002270| 23 65 6c 69 66 20 64 65 | 66 69 6e 65 64 28 4d 53 |#elif de|fined(MS|
|00002280| 44 4f 53 29 0a 58 09 69 | 66 28 28 66 64 20 3d 20 |DOS).X.i|f((fd = |
|00002290| 6f 70 65 6e 28 66 69 6c | 65 6e 61 6d 65 2c 20 4f |open(fil|ename, O|
|000022a0| 5f 52 44 4f 4e 4c 59 2c | 20 30 36 34 30 29 29 3c |_RDONLY,| 0640))<|
|000022b0| 30 29 7b 0a 58 09 09 70 | 72 69 6e 74 66 28 22 43 |0){.X..p|rintf("C|
|000022c0| 61 6e 6e 6f 74 20 6f 70 | 65 6e 20 74 65 6d 70 6f |annot op|en tempo|
|000022d0| 72 61 72 79 20 66 69 6c | 65 20 66 6f 72 20 72 65 |rary fil|e for re|
|000022e0| 61 64 5c 6e 22 29 3b 0a | 58 09 09 65 78 69 74 28 |ad\n");.|X..exit(|
|000022f0| 31 29 3b 0a 58 23 65 6c | 73 65 0a 58 09 69 66 28 |1);.X#el|se.X.if(|
|00002300| 28 66 64 20 3d 20 6f 70 | 65 6e 28 66 69 6c 65 6e |(fd = op|en(filen|
|00002310| 61 6d 65 2c 20 4f 5f 52 | 44 4f 4e 4c 59 29 29 3c |ame, O_R|DONLY))<|
|00002320| 30 29 7b 0a 58 09 09 70 | 72 69 6e 74 66 28 22 43 |0){.X..p|rintf("C|
|00002330| 61 6e 6e 6f 74 20 6f 70 | 65 6e 20 74 65 6d 70 6f |annot op|en tempo|
|00002340| 72 61 72 79 20 66 69 6c | 65 20 66 6f 72 20 72 65 |rary fil|e for re|
|00002350| 61 64 5c 6e 22 29 3b 0a | 58 09 09 65 78 69 74 28 |ad\n");.|X..exit(|
|00002360| 31 29 3b 0a 58 23 65 6e | 64 69 66 0a 58 09 7d 0a |1);.X#en|dif.X.}.|
|00002370| 58 0a 58 09 09 09 2f 2a | 73 74 61 72 74 20 74 69 |X.X.../*|start ti|
|00002380| 6d 69 6e 67 2a 2f 0a 58 | 23 69 66 64 65 66 20 4e |ming*/.X|#ifdef N|
|00002390| 4f 54 49 4d 45 0a 58 09 | 70 72 69 6e 74 66 28 22 |OTIME.X.|printf("|
|000023a0| 73 74 61 72 74 20 74 69 | 6d 69 6e 67 5c 6e 22 29 |start ti|ming\n")|
|000023b0| 3b 0a 58 23 65 6e 64 69 | 66 0a 58 0a 58 09 70 72 |;.X#endi|f.X.X.pr|
|000023c0| 69 6e 74 66 28 22 5c 6e | 52 65 61 64 69 6e 67 20 |intf("\n|Reading |
|000023d0| 74 68 65 20 66 69 6c 65 | 2e 2e 2e 22 29 3b 0a 58 |the file|...");.X|
|000023e0| 09 73 74 61 72 74 74 69 | 6d 65 32 20 3d 20 74 69 |.startti|me2 = ti|
|000023f0| 6d 65 28 30 29 3b 0a 58 | 20 20 20 66 6f 72 28 69 |me(0);.X| for(i|
|00002400| 3d 30 3b 20 69 3c 6e 75 | 6d 72 65 63 73 3b 20 69 |=0; i<nu|mrecs; i|
|00002410| 2b 2b 29 20 7b 0a 58 09 | 69 66 28 72 65 61 64 28 |++) {.X.|if(read(|
|00002420| 66 64 2c 20 62 75 66 66 | 65 72 2c 20 28 75 6e 73 |fd, buff|er, (uns|
|00002430| 69 67 6e 65 64 29 20 72 | 65 63 6c 65 6e 29 20 3c |igned) r|eclen) <|
|00002440| 20 30 29 0a 58 09 09 70 | 65 72 72 6f 72 28 22 52 | 0).X..p|error("R|
|00002450| 65 61 64 20 65 72 72 6f | 72 22 29 3b 0a 58 20 20 |ead erro|r");.X |
|00002460| 20 20 7d 0a 58 23 69 66 | 64 65 66 20 4e 4f 54 49 | }.X#if|def NOTI|
|00002470| 4d 45 0a 58 09 70 72 69 | 6e 74 66 28 22 73 74 6f |ME.X.pri|ntf("sto|
|00002480| 70 20 74 69 6d 69 6e 67 | 5c 6e 22 29 3b 0a 58 23 |p timing|\n");.X#|
|00002490| 65 6e 64 69 66 0a 58 23 | 69 66 64 65 66 20 54 49 |endif.X#|ifdef TI|
|000024a0| 4d 45 0a 58 09 74 6f 74 | 61 6c 74 69 6d 65 20 3d |ME.X.tot|altime =|
|000024b0| 20 74 69 6d 65 28 30 29 | 20 2d 20 73 74 61 72 74 | time(0)| - start|
|000024c0| 74 69 6d 65 32 3b 0a 58 | 0a 58 09 70 72 69 6e 74 |time2;.X|.X.print|
|000024d0| 66 28 22 25 64 20 73 65 | 63 6f 6e 64 73 5c 6e 22 |f("%d se|conds\n"|
|000024e0| 2c 20 74 6f 74 61 6c 74 | 69 6d 65 29 3b 0a 58 09 |, totalt|ime);.X.|
|000024f0| 69 66 28 74 6f 74 61 6c | 74 69 6d 65 21 3d 30 29 |if(total|time!=0)|
|00002500| 0a 58 09 7b 20 20 20 0a | 58 09 20 20 20 20 70 72 |.X.{ .|X. pr|
|00002510| 69 6e 74 66 28 22 5c 6e | 49 4f 5a 4f 4e 45 20 70 |intf("\n|IOZONE p|
|00002520| 65 72 66 6f 72 6d 61 6e | 63 65 20 6d 65 61 73 75 |erforman|ce measu|
|00002530| 72 65 6d 65 6e 74 73 3a | 5c 6e 22 29 3b 0a 58 09 |rements:|\n");.X.|
|00002540| 20 20 20 20 70 72 69 6e | 74 66 28 22 5c 74 25 6c | prin|tf("\t%l|
|00002550| 64 20 62 79 74 65 73 2f | 73 65 63 6f 6e 64 20 66 |d bytes/|second f|
|00002560| 6f 72 20 77 72 69 74 69 | 6e 67 20 74 68 65 20 66 |or writi|ng the f|
|00002570| 69 6c 65 5c 6e 22 2c 0a | 58 09 09 20 28 6c 6f 6e |ile\n",.|X.. (lon|
|00002580| 67 29 20 28 28 6e 75 6d | 72 65 63 73 2a 72 65 63 |g) ((num|recs*rec|
|00002590| 6c 65 6e 29 2f 77 72 69 | 74 65 74 69 6d 65 29 20 |len)/wri|tetime) |
|000025a0| 29 3b 0a 58 09 20 20 20 | 20 70 72 69 6e 74 66 28 |);.X. | printf(|
|000025b0| 22 5c 74 25 6c 64 20 62 | 79 74 65 73 2f 73 65 63 |"\t%ld b|ytes/sec|
|000025c0| 6f 6e 64 20 66 6f 72 20 | 72 65 61 64 69 6e 67 20 |ond for |reading |
|000025d0| 74 68 65 20 66 69 6c 65 | 5c 6e 22 2c 0a 58 09 09 |the file|\n",.X..|
|000025e0| 28 6c 6f 6e 67 29 20 28 | 28 6e 75 6d 72 65 63 73 |(long) (|(numrecs|
|000025f0| 2a 72 65 63 6c 65 6e 29 | 2f 74 6f 74 61 6c 74 69 |*reclen)|/totalti|
|00002600| 6d 65 29 20 29 3b 0a 58 | 09 20 20 20 20 69 66 20 |me) );.X|. if |
|00002610| 28 74 6f 74 61 6c 74 69 | 6d 65 20 3c 20 54 4f 4f |(totalti|me < TOO|
|00002620| 46 41 53 54 29 20 7b 0a | 58 09 09 67 6f 6f 64 6d |FAST) {.|X..goodm|
|00002630| 65 67 73 20 3d 20 28 54 | 4f 4f 46 41 53 54 2f 74 |egs = (T|OOFAST/t|
|00002640| 6f 74 61 6c 74 69 6d 65 | 29 2a 32 2a 6d 65 67 61 |otaltime|)*2*mega|
|00002650| 62 79 74 65 73 3b 0a 58 | 09 09 70 72 69 6e 74 66 |bytes;.X|..printf|
|00002660| 28 22 5c 6e 54 68 69 73 | 20 6d 61 63 68 69 6e 65 |("\nThis| machine|
|00002670| 20 69 73 20 66 61 73 74 | 20 28 6f 72 20 69 73 20 | is fast| (or is |
|00002680| 75 73 69 6e 67 20 61 20 | 64 69 73 6b 20 63 61 63 |using a |disk cac|
|00002690| 68 65 29 21 5c 6e 22 29 | 3b 0a 58 09 09 70 72 69 |he)!\n")|;.X..pri|
|000026a0| 6e 74 66 28 22 59 6f 75 | 20 77 69 6c 6c 20 67 65 |ntf("You| will ge|
|000026b0| 74 20 61 20 6d 6f 72 65 | 20 61 63 63 75 72 61 74 |t a more| accurat|
|000026c0| 65 20 6d 65 61 73 75 72 | 65 20 6f 66 20 69 74 73 |e measur|e of its|
|000026d0| 5c 6e 22 29 3b 0a 58 09 | 09 70 72 69 6e 74 66 28 |\n");.X.|.printf(|
|000026e0| 22 70 65 72 66 6f 72 6d | 61 6e 63 65 20 62 79 20 |"perform|ance by |
|000026f0| 72 65 2d 72 75 6e 6e 69 | 6e 67 20 49 4f 5a 4f 4e |re-runni|ng IOZON|
|00002700| 45 20 75 73 69 6e 67 20 | 74 68 65 20 63 6f 6d 6d |E using |the comm|
|00002710| 61 6e 64 3a 5c 6e 22 29 | 3b 0a 58 09 09 70 72 69 |and:\n")|;.X..pri|
|00002720| 6e 74 66 28 22 5c 6e 5c | 74 69 6f 7a 6f 6e 65 20 |ntf("\n\|tiozone |
|00002730| 25 64 20 22 2c 20 67 6f | 6f 64 6d 65 67 73 29 3b |%d ", go|odmegs);|
|00002740| 0a 58 09 09 70 72 69 6e | 74 66 28 22 5c 74 28 69 |.X..prin|tf("\t(i|
|00002750| 2e 65 2e 2c 20 66 69 6c | 65 20 73 69 7a 65 20 3d |.e., fil|e size =|
|00002760| 20 25 64 20 6d 65 67 61 | 62 79 74 65 73 29 5c 6e | %d mega|bytes)\n|
|00002770| 22 2c 20 67 6f 6f 64 6d | 65 67 73 29 3b 0a 58 09 |", goodm|egs);.X.|
|00002780| 20 20 20 20 7d 0a 58 09 | 7d 20 65 6c 73 65 20 7b | }.X.|} else {|
|00002790| 0a 58 09 20 20 20 20 67 | 6f 6f 64 72 65 63 6c 20 |.X. g|oodrecl |
|000027a0| 3d 20 72 65 63 6c 65 6e | 2f 32 3b 0a 58 09 20 20 |= reclen|/2;.X. |
|000027b0| 20 20 70 72 69 6e 74 66 | 28 22 5c 6e 49 2f 4f 20 | printf|("\nI/O |
|000027c0| 65 72 72 6f 72 20 64 75 | 72 69 6e 67 20 72 65 61 |error du|ring rea|
|000027d0| 64 2e 20 20 54 72 79 20 | 61 67 61 69 6e 20 77 69 |d. Try |again wi|
|000027e0| 74 68 20 74 68 65 20 63 | 6f 6d 6d 61 6e 64 3a 5c |th the c|ommand:\|
|000027f0| 6e 22 29 3b 0a 58 09 20 | 20 20 20 70 72 69 6e 74 |n");.X. | print|
|00002800| 66 28 22 5c 6e 5c 74 69 | 6f 7a 6f 6e 65 20 25 64 |f("\n\ti|ozone %d|
|00002810| 20 25 64 20 22 2c 6d 65 | 67 61 62 79 74 65 73 2c | %d ",me|gabytes,|
|00002820| 20 28 69 6e 74 29 20 67 | 6f 6f 64 72 65 63 6c 29 | (int) g|oodrecl)|
|00002830| 3b 0a 58 09 20 20 20 20 | 70 72 69 6e 74 66 28 22 |;.X. |printf("|
|00002840| 5c 74 28 69 2e 65 2e 20 | 72 65 63 6f 72 64 20 73 |\t(i.e. |record s|
|00002850| 69 7a 65 20 3d 20 25 64 | 20 62 79 74 65 73 29 5c |ize = %d| bytes)\|
|00002860| 6e 22 2c 20 28 69 6e 74 | 29 20 67 6f 6f 64 72 65 |n", (int|) goodre|
|00002870| 63 6c 29 3b 0a 58 09 7d | 0a 58 23 65 6e 64 69 66 |cl);.X.}|.X#endif|
|00002880| 0a 58 20 20 20 20 63 6c | 6f 73 65 28 66 64 29 3b |.X cl|ose(fd);|
|00002890| 0a 58 23 69 66 6e 64 65 | 66 20 56 4d 53 0a 58 20 |.X#ifnde|f VMS.X |
|000028a0| 20 20 20 75 6e 6c 69 6e | 6b 28 66 69 6c 65 6e 61 | unlin|k(filena|
|000028b0| 6d 65 29 3b 09 2f 2a 20 | 64 65 6c 65 74 65 20 74 |me);./* |delete t|
|000028c0| 68 65 20 66 69 6c 65 20 | 2a 2f 0a 58 09 09 09 09 |he file |*/.X....|
|000028d0| 09 2f 2a 73 74 6f 70 20 | 74 69 6d 65 72 2a 2f 0a |./*stop |timer*/.|
|000028e0| 58 23 65 6e 64 69 66 0a | 58 23 69 66 64 65 66 09 |X#endif.|X#ifdef.|
|000028f0| 4d 53 44 4f 53 0a 58 09 | 66 72 65 65 28 62 75 66 |MSDOS.X.|free(buf|
|00002900| 66 65 72 29 3b 09 09 2f | 2a 20 64 65 61 6c 6c 6f |fer);../|* deallo|
|00002910| 63 61 74 65 20 74 68 65 | 20 6d 65 6d 6f 72 79 20 |cate the| memory |
|00002920| 2a 2f 0a 58 23 65 6e 64 | 69 66 0a 58 23 69 66 64 |*/.X#end|if.X#ifd|
|00002930| 65 66 20 56 4d 53 0a 58 | 72 65 74 75 72 6e 20 53 |ef VMS.X|return S|
|00002940| 53 24 5f 4e 4f 52 4d 41 | 4c 3b 0a 58 23 65 6c 73 |S$_NORMA|L;.X#els|
|00002950| 65 0a 58 72 65 74 75 72 | 6e 20 30 3b 0a 58 23 65 |e.Xretur|n 0;.X#e|
|00002960| 6e 64 69 66 0a 58 7d 0a | 58 0a 58 0a 45 4e 44 5f |ndif.X}.|X.X.END_|
|00002970| 4f 46 5f 46 49 4c 45 0a | 20 20 69 66 20 74 65 73 |OF_FILE.| if tes|
|00002980| 74 20 37 37 32 33 20 2d | 6e 65 20 60 77 63 20 2d |t 7723 -|ne `wc -|
|00002990| 63 20 3c 27 69 6f 7a 6f | 6e 65 2e 63 27 60 3b 20 |c <'iozo|ne.c'`; |
|000029a0| 74 68 65 6e 0a 20 20 20 | 20 65 63 68 6f 20 73 68 |then. | echo sh|
|000029b0| 61 72 3a 20 5c 22 27 69 | 6f 7a 6f 6e 65 2e 63 27 |ar: \"'i|ozone.c'|
|000029c0| 5c 22 20 75 6e 70 61 63 | 6b 65 64 20 77 69 74 68 |\" unpac|ked with|
|000029d0| 20 77 72 6f 6e 67 20 73 | 69 7a 65 21 0a 20 20 66 | wrong s|ize!. f|
|000029e0| 69 0a 20 20 23 20 65 6e | 64 20 6f 66 20 27 69 6f |i. # en|d of 'io|
|000029f0| 7a 6f 6e 65 2e 63 27 0a | 66 69 0a 65 63 68 6f 20 |zone.c'.|fi.echo |
|00002a00| 73 68 61 72 3a 20 45 6e | 64 20 6f 66 20 61 72 63 |shar: En|d of arc|
|00002a10| 68 69 76 65 2e 0a 65 78 | 69 74 20 30 0a 65 78 69 |hive..ex|it 0.exi|
|00002a20| 74 20 30 20 23 20 4a 75 | 73 74 20 69 6e 20 63 61 |t 0 # Ju|st in ca|
|00002a30| 73 65 2e 2e 2e 0a 2d 2d | 20 0a 4b 65 6e 74 20 4c |se....--| .Kent L|
|00002a40| 61 6e 64 66 69 65 6c 64 | 20 20 20 20 20 20 20 20 |andfield| |
|00002a50| 20 20 20 20 20 20 20 20 | 20 20 20 49 4e 54 45 52 | | INTER|
|00002a60| 4e 45 54 3a 20 6b 65 6e | 74 40 73 70 61 72 6b 79 |NET: ken|t@sparky|
|00002a70| 2e 49 4d 44 2e 53 74 65 | 72 6c 69 6e 67 2e 43 4f |.IMD.Ste|rling.CO|
|00002a80| 4d 0a 53 74 65 72 6c 69 | 6e 67 20 53 6f 66 74 77 |M.Sterli|ng Softw|
|00002a90| 61 72 65 2c 20 49 4d 44 | 20 20 20 20 20 20 20 20 |are, IMD| |
|00002aa0| 20 20 20 55 55 43 50 3a | 20 20 20 20 20 75 75 6e | UUCP:| uun|
|00002ab0| 65 74 21 73 70 61 72 6b | 79 21 6b 65 6e 74 0a 50 |et!spark|y!kent.P|
|00002ac0| 68 6f 6e 65 3a 20 20 20 | 20 28 34 30 32 29 20 32 |hone: | (402) 2|
|00002ad0| 39 31 2d 38 33 30 30 20 | 20 20 20 20 20 20 20 20 |91-8300 | |
|00002ae0| 46 41 58 3a 20 20 20 20 | 20 20 28 34 30 32 29 20 |FAX: | (402) |
|00002af0| 32 39 31 2d 34 33 36 32 | 0a 50 6c 65 61 73 65 20 |291-4362|.Please |
|00002b00| 73 65 6e 64 20 63 6f 6d | 70 2e 73 6f 75 72 63 65 |send com|p.source|
|00002b10| 73 2e 6d 69 73 63 2d 72 | 65 6c 61 74 65 64 20 6d |s.misc-r|elated m|
|00002b20| 61 69 6c 20 74 6f 20 6b | 65 6e 74 40 75 75 6e 65 |ail to k|ent@uune|
|00002b30| 74 2e 75 75 2e 6e 65 74 | 2e 0a |t.uu.net|.. |
+--------+-------------------------+-------------------------+--------+--------+