On Thu, Jul 17, 2008 at 11:07, Charles Forsyth <[EMAIL PROTECTED]> wrote:
>> I could imagine that databases use mmap() havily
>
> it's a little mystery for me why they would do that since it's slower (or 
> ought to be),
> because the trap path and fault recovery must do more work than syscall 
> (perhaps much more).
> it's also difficult then to optimise the replacement strategy for the 
> application
> without madvise calls (and you trust those implicitly?) but those are system 
> calls that cost time.
>
>
>

A much more important reason might be the fact that memory mapping of
files is only one function of mmap() and company. Basically when you
have mmap() and munmap() you can write your own allocator (which might
be very useful, especially for databases). I won't delve into using it
for I/O, but a specialized memory allocator can get you a big speedup
- after all application developer knows the memory usage pattern of
his app better than kernel/system library.


Of course, that is assuming that the developer in question has a clue...
-- 
Paweł Lasek

Reply via email to