Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jul 1999 16:25:12 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        James Howard <howardjp@wam.umd.edu>
Cc:        Tim Vanderhoek <vanderh@ecf.utoronto.ca>, "Daniel C. Sobral" <dcs@newsguy.com>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: replacing grep(1)
Message-ID:  <199907292325.QAA80121@apollo.backplane.com>
References:   <Pine.GSO.4.10.9907291856100.11776-100000@rac9.wam.umd.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
:of me.  Unfortunetly he has not posted this version yet so I cannot
:download it and run it myself.  He also says that if mmap fails, he drops
:back to stdio.  This should only happen in the NFS case, the > 2G case,
:etc.

    It should only be the > 2G case or the pipe case.  mmap() works just fine
    over NFS.

    I would not expect a huge speed increase using mmap over read.  mmap()
    tends to be a lot harder on the system then read() (though we are working 
    on that), especially if you are scanning large files.

    Avoiding buffer copies is good, but keep in mind that the cost of accessing
    a location in memory is essentially 0 if the memory is already in the L1
    cache.  So while you may get an improvement going from read() to mmap(),
    which avoids large buffer copies, you will not see much of an improvement
    removing redundancy from the line scan.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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