Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 May 1997 10:36:50 +0100
From:      James Mansion <james@westongold.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: mmap()
Message-ID:  <337AD932.B69@westongold.com>
References:  <199705121841.LAA07971@phaeton.artisoft.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Is this 'because of the way it happens to be implemented' or something
fundamental?

Is there any way that one could add a hint to say that the access will
be sequential, or that it should fault in multiple pages?

Some extra flags as an extension?

Ideally one might try to keep a simple history and spot sequential
access after a couple of pages are faulted in, and set the option
automatically.

James

Terry Lambert wrote:
> 
> >   this question must be old, but anyway...
> >
> >   why mmap() under freebsd (at least, 2.1) almost two times slower than
> > read()? I've tryed to read large files, with multiple mmap()'ing file into
> > buffer with size = getpagesize() * 10, and with/without madvise()...
> 
> Because of the way buffering is implemented, mmap() can not trigger
> predictive read-ahead, while read() can.  The performance improvement
> in read() for sequential I/O comes from read-ahead.
> 
>                                         Regards,
>                                         Terry Lambert
>                                         terry@lambert.org
> ---
> Any opinions in this posting are my own and not those of my present
> or previous employers.

-- 
Westongold Ltd                 C++/Java
 Multithread development and libraries
+44 1920 444284     info@westongold.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?337AD932.B69>