4 ms·
> Not that you'd want to mmap() if you cared about performance. So far I never used mmap (no usecase that pushed me to find alternatives for the usual open&see
by zepearl 5y ago
> Not that you'd want to mmap() if you cared about performance.
So far I never used mmap (no usecase that pushed me to find alternatives for the usual open&seek), but I was always curious about it.
Your statement made me search & find this ( https://unix.stackexchange.com/questions/474926/how-does-memory-mapping-a-file-have-significant-performance-increases-over-the-s https://unix.stackexchange.com/questions/474926/how-does-mem... ) => interesting.
Thanks :)
- BeeOnRope 5y agoYou might also consider this Q&A whose answers contain several reasons mmap might be faster, and several why it may be slower: https://stackoverflow.com/questions/45972/mmap-vs-reading-blocks https://stackoverflow.com/questions/45972/mmap-vs-reading-bl...
- IgorPartola 5y agommap has a bunch of other use cases other than opening files. Shared memory, fast memory allocation, disk-backed memory regions. I believe it was invented after the gun that shoots both forwards and backwards failed to deliver on its fatality quota.