Home | Reviews | GUIpedia | Forum | Fun500


HorvatMA question on storing binary files
For a binary file (OPEN x$ FOR BINARY AS #y), what do you think is more efficient - entry major, or field-major order - for a file that is going to have entries added and removed (not just edited) a lot and thus rewritten many times?
2010-06-128:44 AM

BrandonRe:A question on storing binary files
One large opening will be faster, assuming I understand correctly. For example: In my F5I icon format I read all 1024bytes at once which is much faster than reading the file pixel by pixel.
2010-06-129:01 AM

HorvatMRe:A question on storing binary files
The file will be read all in one go, so the problem is more about adding or removing entries and then writing the file.
2010-06-1210:23 AM

BrandonRe:A question on storing binary files
Writing all at once will be faster than writing pieces at a time.
2010-06-1210:30 AM

ToddRe:A question on storing binary files
Like Brandon said, it's more efficient to have a larger buffer size.
2010-06-121:40 PM

DickRe:A question on storing binary files
Don't know much about this, but I'd assume the less disk I/O the better.  So it should be faster to only write/delete what you need, but it might be tricky in some situations.  Best way would be to try both and time your code. QB also allows random access files.   http://en.wikipedia.org/wiki/Random_access
2010-06-131:48 AM

ToddRe:A question on storing binary files
The best way is to know how your file format works and seek to a specific block to read.
2010-06-139:59 AM

Other


2021 Brandon Cornell