Your saying that there is only ever NEW items inserted into the hash table? no items values are updated? If so then writing to file each new value using a fopen/fwrites/fclose would be the fastest I would assume. (always do the fclose, as this is the only time some OS's directory info such as filesize is updated). However from what i gathered from what you said about the hashtable I assumed values in it were being updated all over, if this is the case then simply adding entries to the file well be no use.