Re: 2.4 Official -- memory stuff
- Posted by Matt Lewis <matthewwalkerlewis at yahoo.com> Jul 08, 2003
- 485 views
--- Robert Craig <rds at RapidEuphoria.com> wrote: <snip> > - create sequences at their final size, rather than > "growing them" with append or concatenation Or, you can compromise. I often do this. Grow the sequence by concatenating in chunks (of 100, 1000, or whatever makes sense for your purposes, or based on some trial and error to figure out an optimal size). Use an index variable, and another that tracks the length of the sequence, and whenever index=max, add another chunk. It's a really nice way to get the benefits of preallocation without wasting too much memory. Matt Lewis __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com