From owner-freebsd-current Fri Apr 14 20:09:05 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id UAA23976 for current-outgoing; Fri, 14 Apr 1995 20:09:05 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id UAA23939 for ; Fri, 14 Apr 1995 20:08:25 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id NAA01886; Sat, 15 Apr 1995 13:02:54 +1000 Date: Sat, 15 Apr 1995 13:02:54 +1000 From: Bruce Evans Message-Id: <199504150302.NAA01886@godzilla.zeta.org.au> To: davidg@Root.COM, jgreco@brasil.moneng.mei.com Subject: Re: mmap bugs gone yet? Cc: freebsd-current@FreeBSD.org, hsu@cs.hut.fi Sender: current-owner@FreeBSD.org Precedence: bulk >>> With the merged VM/buffer cache, i doubt it will buy too much to mmap >>> the files at all. >> >>This was not true on my Sun 3/60. I never investigated to find out why, >>however. > mmap should be faster at accessing files randomly and will eliminate an >extra copy compared with doing read() system calls. It might be slower when >modifying large amounts of large files. I think overall mmap would be faster, >but YYMV. Does mmap() do read-ahead or read-behind? If it does, then it wouldn't be so good for random access. If it doesn't then it wouldn't be so good for seuqential access. What exactly happens if a huge file (larger than physical memory) is accessed sequentially using read() and mmap()? E.g., for simple (simplistic?) copying of files: read-write: size = huge; buf = malloc(size); read(0, buf, size); write(1, buf, size); mmap: something I can't write without RTFM :-) Bruce