Open Ceiridge opened 1 year ago
Before the file is written to, the new file size is already known and it is already allocated accordingly. Also, dynamic sizes would in total decrease performance even more, because random access would not be possible and sizes would have to be stored.
This could work with search trees. Further research is needed
Performance can be improved by dynamically allocating a rather big block/amount of sectors while a file is being written to. Once the file is fully written, the spare sectors can be deallocated. This is similar to ArrayLists, in most cases without the disadvantage of wasting memory. Also, the sectors can be of dynamic size by storing a pointer to the next sector directly next to the data.