Originally Posted by
Talroth
Have you mapped out your memory usage in your algorithm?
What exactly are you doing with your system memory?
that's been this morning's work, aside from a quick trip to ikea.
the generator is written in perl, so i'm at perl's mercy regarding memory allocation and usage.
and perl is rather notorious for sacrificing ridiculous piles of memory for performance.
i've converted the cell map from an array of arrays of integers (lazy)
to an array of strings, using vec() to manipulate it.
$map->[$r][$c] # uses a lot of memory
vec($map->[$r],$c,1) # a lot less memory, and isn't any slower
much better! a colossal cavern, standard style and print scale, now takes 3.5 minutes to generate,
and the process consumes just over 500 MB of memory, instead of the 3+ GB it was sucking down before.
the parchment style is the most computationally expensive, and pushes that to 7.5 minutes.
the resulting image is an 8051 x 8051 pixel jpeg, 13 MB in size.