News for hackers. Stuff that matters.
Re:What's wrong with 1975 programming by btilly on Wednesday July 28, 2010 @07:23PM (#1555996)
If your data structures can be serialized using 1/10 of the space and you can identify what you're not going to use for a while, then why not serialize it into RAM that way and let VM serialize it to disk if needed? You accomplish the same thing, but with less code and fewer system calls.

To me the big reasons to serialize to disk are as a way of sharing data between processes, and as a way of making data permanent. But not for performance. Because compared to RAM, disk has none.

Re:What's wrong with 1975 programming by antirez on Thursday July 29, 2010 @01:16PM (#1558283)
Sorry I replied to the wrong comment, check one child later please ;) The best representation in memory and on disk are usually completely different, while VM will force you to use the same for both the worlds.
Re:What's wrong with 1975 programming by btilly on Thursday July 29, 2010 @04:57PM (#1559233)
I can't find the "one child later" that you're referring to.

As for the best representation, I am not sure I agree. I agree that the best representation for frequently accessed data and seldom accessed data are frequently very different. Of course normally the former is in RAM while the latter is on disk. However it is not obvious to me that it is at all a bad thing to have some space used in RAM by infrequently accessed data. And if it is not, then you wind up with the solution I suggested. Just write out the data as you want it on disk, into RAM, don't touch it, and let the VM worry about when (and if) it needs to actually be paged to disk.

Of course this doesn't work if you're not using virtual memory. :-)