Appending lots of bytes is slow
Brought to you by:
kimmov
Appending lots of bytes to end of the data (empty file or some existing data) is slow. This is because AppendDlg::Apply() expands the array and then zeroes bytes one by one (using table operator []).
Seems there are couple of other similar places in Frhed code where:
- SimpleArray::SetSize() is called to set new size
- SimpleArray::ExpandToSize() is called to expand to new size
- for loop is used to zero new bytes allocated