<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Regarding this code:<div class=""><br class=""></div><div class=""><blockquote type="cite" class="">SetLength(Array,Length(Array)+1);<br class="">Array[High(Array)] := …<br class=""></blockquote><br class=""></div><div class="">as I understood from (<a href="http://wiki.freepascal.org/Dynamic_array" class="">http://wiki.freepascal.org/Dynamic_array</a>), SetLength will create a copy of the array and free the memory of the shorter array. In this case, a lot of memory operations and copy operations are performed thus degrading the performances of the code. Then it would be unwise to use such strategy: better allocate the size of the array correctly at the beginning of the run, or resize the array by block, to decrease the frequency of such operation:</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class="">SetLength(Array,Length(Array)+N);</blockquote><br class=""></div><div class="">Can somebody confirm (or invalidate) this?</div><div class=""><br class=""></div><div class="">Ciao,</div><div class="">Gilles Marcou</div></body></html>