#39 Appending lots of bytes is slow

open
nobody
None
5
2009-04-11
2009-04-11
Kimmo Varis
No

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

Discussion