background preloader

Dbm

Facebook Twitter

Read vs. mmap (or io vs. page faults) Mikhail Teterin mi+kde at aldan.algebra.com Mon Jun 21 22:08:46 PDT 2004 On Monday 21 June 2004 08:15 pm, Matthew Dillon wrote: = :The mmap interface is supposed to be more efficient -- theoreticly = :-- because it requires one less buffer-copying, and because it = :(together with the possible madvise()) provides the kernel with more = :information thus enabling it to make better (at least -- no worse) = :decisions. = Well, I think you forgot my earlier explanation regarding buffer = copying. = Buffer copying is a very cheap operation if it occurs = within the L1 or L2 cache, and that is precisely what is happening = when you read() int This could explain, why using mmap is not faster than read, but it does not explain, why it is slower.

read vs. mmap (or io vs. page faults)

I'm afraid, your vast knowledge of the internals of the kernel workings obscure your vision. Fundamental Specifications of Tokyo Cabinet Version 1.