If you know roughly how large the stack seq can get, you may want to try

[https://nim-lang.org/docs/system.html#newSeqOfCap%2CNatural](https://nim-lang.org/docs/system.html#newSeqOfCap%2CNatural)

to avoid or reduce reallocations.

In a small benchmark I wrote some time ago, using `newSeqOfCap` to set the 
initial capacity made a noticable difference compared to using `newSeq`.

Reply via email to