Many thanks! That function greatly improves random read speed.
My new program is here: http://pastebin.com/yM3DsrLN (Note: It didn't compile from command line, but it compiles in NetBeans, I don't really know what's the reason for that)
Results on NetBeans 6.9 using my desktop setup (as I've described in first post), except that compiler options are default to Release profile in NetBeans:
Additionally, results on netbook, again this time I've run it in NetBeans (version 7.0 this time) and Release profile:
Linear write time: 780000
Random write time: 3600000
Random read time: 5160000, control value: -59606515
Random read time: 2160000, control value: -59606515, prefetch queue size: 8
RUN SUCCESSFUL (total time: 12s)
Two cases are too small data set to draw conclusions but nevertheless this knowledge is very valuable.
Linear write time: 2000000
Random write time: 21160000
Random read time: 21560000, control value: -59606515
Random read time: 10420000, control value: -59606515, prefetch queue size: 8
RUN SUCCESSFUL (total time: 55s)
Could you run the new program?
Also I would want someone with Nehalem or Sandy Bridge based processor to post results.