Hi Dave,
First, thanks for the analysis!
Am Mittwoch, 14. März 2012, 19:09:52 schrieb Dave Glick:
In any case, my question boils down to wondering if there is a way to force the DiskData class to use a persistent DataOutput instance instead of creating and closing a new one for every write? Instead, could a DataOutput be kept open until the database is "unpinned" and simply flushed on each write? Would this cause any problems with the current GUI, server, etc. uses?
I think you are right, and it would be, of course, much more efficient not to open/close the DataOutput on each call of write(). I don't see any problem of keeping the file with the meta data open during the whole life-cycle of a DiskData instance (I may be however wrong, so Christian should say his opinion). The problem which I see is how to make that, because the class org.basex.io.out.DataOutput does not have a method to reset the file offset to the beginning of the file. Therefore, either such a method should be added, or the meta-data should be written using a RandomAccessFile (e.g. org.basex.io.random.DiskAccess).
Regards, Dimitar