From owner-freebsd-hackers Mon May 12 11:47:45 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id LAA27385 for hackers-outgoing; Mon, 12 May 1997 11:47:45 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id LAA27375 for ; Mon, 12 May 1997 11:47:40 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id LAA07971; Mon, 12 May 1997 11:41:45 -0700 From: Terry Lambert Message-Id: <199705121841.LAA07971@phaeton.artisoft.com> Subject: Re: mmap() To: vadim@tversu.ac.ru (Vadim Kolontsov) Date: Mon, 12 May 1997 11:41:45 -0700 (MST) Cc: freebsd-hackers@FreeBSD.ORG In-Reply-To: <19970512115004.56026@tversu.ac.ru> from "Vadim Kolontsov" at May 12, 97 11:50:05 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > 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.