Seek 200 Kbytes and repeat the pattern. This again is a typical application behavior for applications that
have data structures contained within a file and is accessing a particular region of the data structure.
Most operating systems do not detect this behavior or implement any techniques to enhance the
performance under this type of access behavior.
This access behavior can also sometimes produce interesting performance anomalies. An example would
be if the application’s stride causes a particular disk, in a striped file system, to become the bottleneck.
Fwrite: This test measures the performance of writing a file using the library function fwrite().
This is a library routine that performs buffered write operations. The buffer is within the user’s address
space. If an application were to write in very small size transfers then the buffered & blocked I/O
functionality of fwrite() can enhance the performance of the application by reducing the number of actual
operating system calls and increasing the size of the transfers when operating system calls are made.
This test is writing a new file so again the overhead of the metadata is included in the measurement.
Frewrite: This test measures the performance of writing a file using the library function fwrite().
This is a library routine that performs buffered & blocked write operations. The buffer is within the user’s
address space. If an application were to write in very small size transfers then the buffered & blocked I/O
functionality of fwrite() can enhance the performance of the application by reducing the number of actual
operating system calls and increasing the size of the transfers when operating system calls are made.
This test is writing to an existing file so the performance should be higher as there are no metadata
operations required.
Fread: This test measures the performance of reading a file using the library function fread(). This
is a library routine that performs buffered & blocked read operations. The buffer is within the user’s
address space. If an application were to read in very small size transfers then the buffered & blocked I/O
functionality of fread() can enhance the performance of the application by reducing the number of actual
operating system calls and increasing the size of the transfers when operating system calls are made.
Freread: This test is the same as fread above except that in this test the file that is being read was
read in the recent past. This should result in higher performance as the operating system is likely to have
the file data in cache.
Specialized tests:
Mmap: Many operating systems support the use of mmap() to map a file into a user’s address
space. Once this mapping is in place then stores to this location in memory will result in the data being
stored going to a file. This is handy if an application wishes to treat files as chunks of memory. An example
would be to have an array in memory that is also being maintained as a file in the files system.
The semantics of mmap files is somewhat different than normal files. If a store to the memory location is
done then no actual file I/O may occur immediately. The use of the msyc() with the flags MS_SYNC, and
MS_ASYNC control the coherency of the memory and the file. A call to msync() with MS_SYNC will
force the contents of memory to the file and wait for it to be on storage before returning to the application.
A call to msync() with the flag MS_ASYNC tells the operating system to flush the memory out to storage
using an asynchronous mechanism so that the application may return into execution without waiting for the
data to be written to storage.
This test measures the performance of using the mmap() mechanism for performing I/O.
Async I/O: Another mechanism that is supported by many operating systems for performing I/O
is POSIX async I/O. The application uses the POSIX standard async I/O interfaces to accomplish this.
Example: aio_write(), aio_read(), aio_error(). This test measures the performance of the POSIX async I/O
mechanism.