4 ms·
I'm not sure it is a good idea, performance wise. A database application can use differently optimised strategies (data structures, etc.) for memory or disk acc
by _0ffh 8y ago
I'm not sure it is a good idea, performance wise. A database application can use differently optimised strategies (data structures, etc.) for memory or disk access. It can't if it doesn't know what's in memory, or on disk.
- als0 8y ago> It can't if it doesn't know what's in memory, or on disk. For maximum performance the application can still be aware of the different memory types. You may still have to copy memory around (from volatile to persistent state) but it's possible to avoid the cost of serialisation.
- deleted 8y ago[deleted]
- Someone 8y agoPresumably, one can still lock down pages in memory (https://www.freebsd.org/cgi/man.cgi?query=mlock https://www.freebsd.org/cgi/man.cgi?query=mlock, http://man7.org/linux/man-pages/man2/mlock.2.html http://man7.org/linux/man-pages/man2/mlock.2.html). So, build default data structures as if everything is swapped out, and add structures designed for use in memory for caching that data. Alternatively, only use structures optimized for in memory use, and trust your OS to keep the active set paged in (easier, but can harm performance if you have much more data than RAM)