Syntactic Confectionery Delight | |
PerlMonks |
Re: write hash to disk after memory limitby FloydATC (Deacon) |
on Mar 13, 2015 at 21:59 UTC ( [id://1120006]=note: print w/replies, xml ) | Need Help?? |
Swapping is the very act of writing to disk after the physical memory limit has been reached, is it not? When choosing what chunks of memory to swap out, the operating system will usually pick those that have not been in recent use. Unless you can write a significantly smarter algorithm, I'd expect the performance to be worse if you try to swap manually. Only if you can make better guesses on what chunks of data you won't be needing any time soon will you be able to outperform the memory manager. But then, if you knew you wouldn't be needing parts of the data in memory, you probably wouldn't have bothered placing it there to begin with, right? If the data set was 10 times larger, maybe I'd spend some time trying to come up with a completely different approach. Today, for a 17 GB data structure I'd seriously consider just buying more RAM so I could get back to work. The sad truth is, one day wasted on writing, testing and debugging clever code costs far more than a 16 GB stick these days.
-- FloydATC
Time flies when you don't know what you're doing
In Section
Seekers of Perl Wisdom
|
|