Improving file access
Posted 04 July 2006 - 12:12 PM
Can anyone recommend the best way to access these files?
At the moment I open the file and keep it open. Each time I need to write a block I seek to the place and write there.
Its thrashing the HDD a bit. I'm just wondering what the best way of writing to the hard drive is?
Edit: What I'm looking for are just rules of thumb for good file access patterns.
Posted 04 July 2006 - 12:48 PM
Another thing to look into would be memory-mapped I/O, which lets the OS make the decisions about when to do the disk writes. It could be more efficient if the OS is smart or has a smart driver.
Also, what kind of platform are you running this on? If you have any control over the hardware, you should look into using a hard drive interface that supports Native Command Queuing, such as SATA. This lets the disk itself take advantage of knowledge about the physical location of files to schedule writes and reads so that they execute as fast as possible.
Posted 04 July 2006 - 01:01 PM
I'm thinking that the only way I'm going to improve things is to cache the writes.
Of course I dont have very much memory so how do I figure out the best size for my cache? Is there some kind of disk block size? I've seen 64k in a few articles.
Posted 05 July 2006 - 01:46 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users